3 describe 'archive::artifactory' do
4 let(:facts) { { os: { family: 'RedHat' }, puppetversion: '4.4.0' } }
6 # Mock Puppet V4 API ruby function with a puppet language function equivalent
8 'function archive::artifactory_checksum($url,$type) { return \'0d4f4b4b039c10917cfc49f6f6be71e4\' }'
11 context 'artifactory archive with defaults' do
12 let(:title) { '/opt/app/example.zip' }
15 url: 'http://home.lan:8081/artifactory/path/example.zip'
20 is_expected.to contain_archive('/opt/app/example.zip').with(
21 path: '/opt/app/example.zip',
22 source: 'http://home.lan:8081/artifactory/path/example.zip',
23 checksum: '0d4f4b4b039c10917cfc49f6f6be71e4',
29 is_expected.to contain_file('/opt/app/example.zip').with(
33 require: 'Archive[/opt/app/example.zip]'
38 context 'artifactory archive with path' do
39 let(:title) { 'example.zip' }
42 archive_path: '/opt/app',
43 url: 'http://home.lan:8081/artifactory/path/example.zip',
51 is_expected.to contain_archive('/opt/app/example.zip').with(
52 path: '/opt/app/example.zip',
53 source: 'http://home.lan:8081/artifactory/path/example.zip',
54 checksum: '0d4f4b4b039c10917cfc49f6f6be71e4',
60 is_expected.to contain_file('/opt/app/example.zip').with(
64 require: 'Archive[/opt/app/example.zip]'