diff --git a/spec/classes/pulpcore_spec.rb b/spec/classes/pulpcore_spec.rb index 52e59e06..9a383f61 100644 --- a/spec/classes/pulpcore_spec.rb +++ b/spec/classes/pulpcore_spec.rb @@ -30,6 +30,56 @@ is_expected.to contain_file('/var/lib/pulp/upload') end + context 'with allowed import paths' do + let :params do + { + allowed_import_path: ['/test/path', '/test/path2'], + } + end + + it do + is_expected.to compile.with_all_deps + is_expected.to contain_concat__fragment('base') + .with_content(%r{ALLOWED_IMPORT_PATHS = \["/test/path", "/test/path2"\]}) + + end + end + + context 'with empty allowed import paths' do + it do + is_expected.to compile.with_all_deps + is_expected.to contain_concat__fragment('base') + .with_content(%r{ALLOWED_IMPORT_PATHS = \["/var/lib/pulp/sync_imports"\]}) + + end + end + + context 'with allowed export paths' do + let :params do + { + allowed_export_path: ['/test/path', '/test/path2'], + } + end + + it do + is_expected.to compile.with_all_deps + is_expected.to contain_concat__fragment('base') + .with_content(%r{ALLOWED_EXPORT_PATHS = \["/test/path", "/test/path2"\]}) + + end + end + + context 'with empty allowed export paths' do + it do + is_expected.to compile.with_all_deps + is_expected.to contain_concat__fragment('base') + .with_content(%r{ALLOWED_EXPORT_PATHS = \[\]}) + + end + end + + + it 'sets up static files' do is_expected.to contain_class('pulpcore::static') is_expected.to contain_file('/var/lib/pulp/assets') @@ -323,54 +373,6 @@ end end - context 'with allowed import paths' do - let :params do - { - allowed_import_path: ['/test/path', '/test/path2'], - } - end - - it do - is_expected.to compile.with_all_deps - is_expected.to contain_concat__fragment('base') - .with_content(%r{ALLOWED_IMPORT_PATHS = \["/test/path", "/test/path2"\]}) - - end - end - - context 'with empty allowed import paths' do - it do - is_expected.to compile.with_all_deps - is_expected.to contain_concat__fragment('base') - .with_content(%r{ALLOWED_IMPORT_PATHS = \["/var/lib/pulp/sync_imports"\]}) - - end - end - - context 'with allowed export paths' do - let :params do - { - allowed_export_path: ['/test/path', '/test/path2'], - } - end - - it do - is_expected.to compile.with_all_deps - is_expected.to contain_concat__fragment('base') - .with_content(%r{ALLOWED_EXPORT_PATHS = \["/test/path", "/test/path2"\]}) - - end - end - - context 'with empty allowed export paths' do - it do - is_expected.to compile.with_all_deps - is_expected.to contain_concat__fragment('base') - .with_content(%r{ALLOWED_EXPORT_PATHS = \[\]}) - - end - end - context 'with custom static dirs' do let :params do {