X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Farchive%2Fspec%2Funit%2Fpuppet%2Fparser%2Ffunctions%2Fgo_md5_spec.rb;fp=3rdparty%2Fmodules%2Farchive%2Fspec%2Funit%2Fpuppet%2Fparser%2Ffunctions%2Fgo_md5_spec.rb;h=7dad352377ebceea9ed323b19a4edb04a6cf734f;hb=ce70d6baf887ae03a2a6a7f5e73eb2e2c3dea208;hp=0000000000000000000000000000000000000000;hpb=0ba93256399fbad7ed8fabfa39c24dd47169dde3;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/archive/spec/unit/puppet/parser/functions/go_md5_spec.rb b/3rdparty/modules/archive/spec/unit/puppet/parser/functions/go_md5_spec.rb new file mode 100644 index 000000000..7dad35237 --- /dev/null +++ b/3rdparty/modules/archive/spec/unit/puppet/parser/functions/go_md5_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe :go_md5 do # rubocop:disable RSpec/DescribeSymbol + before :all do # rubocop:disable RSpec/BeforeAfterAll + Puppet::Parser::Functions.autoloader.loadall + end + + let(:scope) { PuppetlabsSpec::PuppetInternals.scope } + + example_md5 = File.read(fixtures('checksum', 'gocd.md5')) + + it 'retreives file md5' do + url = 'https://gocd.lan/path/file.md5' + uri = URI(url) + PuppetX::Bodeco::Util.stubs(:content).with(uri, username: 'user', password: 'pass').returns(example_md5) + expect(scope.function_go_md5(['user', 'pass', 'filea', url])).to eq '283158c7da8c0ada74502794fa8745eb' + end +end