Skip to content

Commit cc75054

Browse files
author
Kevin Paulisse
committed
Add test case for --environments and --create-symlinks unset
1 parent ed35b86 commit cc75054

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

spec/octocatalog-diff/integration/preserve_environments_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,32 @@
3131
end
3232

3333
context 'with --preserve-environments set' do
34+
context 'and --environment, --create-symlinks unset' do
35+
before(:all) do
36+
@result = OctocatalogDiff::Integration.integration(
37+
spec_fact_file: 'facts.yaml',
38+
spec_repo: 'preserve-environments',
39+
argv: [
40+
'-n', 'rspec-node.github.net',
41+
'--retry-failed-catalog', '0',
42+
'--preserve-environments'
43+
]
44+
)
45+
end
46+
47+
it 'should exit with error status' do
48+
expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
49+
end
50+
51+
it 'should raise OctocatalogDiff::CatalogDiff::Cli::Catalogs::CatalogError' do
52+
expect(@result.exception).to be_a_kind_of(OctocatalogDiff::CatalogDiff::Cli::Catalogs::CatalogError)
53+
end
54+
55+
it 'should fail because ::bar could not be located' do
56+
expect(@result.exception.message).to match(/Could not find class ::bar for rspec-node.github.net/)
57+
end
58+
end
59+
3460
context 'and --environment set to non-existent value' do
3561
before(:all) do
3662
@result = OctocatalogDiff::Integration.integration(

0 commit comments

Comments
 (0)