Add puppet/archive module, required for newer puppet/rabbitmq
[mirror/dsa-puppet.git] / 3rdparty / modules / archive / spec / unit / puppet / parser / functions / artifactory_sha1_spec.rb
1 require 'spec_helper'
2
3 describe :artifactory_sha1 do # rubocop:disable RSpec/DescribeSymbol
4   before :all do # rubocop:disable RSpec/BeforeAfterAll
5     Puppet::Parser::Functions.autoloader.loadall
6   end
7
8   let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
9
10   example_json = File.read(fixtures('checksum', 'artifactory.json'))
11
12   it 'parses sha1' do
13     url = 'https://repo.jfrog.org/artifactory/api/storage/distributions/images/Artifactory_120x75.png'
14     uri = URI(url)
15     PuppetX::Bodeco::Util.stubs(:content).with(uri).returns(example_json)
16     expect(scope.function_artifactory_sha1([url])).to eq 'a359e93636e81f9dd844b2dfb4b89fa876e5d4fa'
17   end
18 end