Skip to content

Commit 7df008d

Browse files
author
Kevin Paulisse
committed
Add an integration with an ENC override specified
1 parent f1f4430 commit 7df008d

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

spec/octocatalog-diff/integration/enc_override_spec.rb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,43 @@
4646
end
4747

4848
describe 'ENC override integration with --enc-override' do
49+
before(:all) do
50+
@result = OctocatalogDiff::Integration.integration(
51+
spec_repo: 'enc-overrides',
52+
spec_fact_file: 'valid-facts.yaml',
53+
hiera_config: 'hiera.yaml',
54+
hiera_path: 'hieradata',
55+
argv: [
56+
'--enc',
57+
OctocatalogDiff::Spec.fixture_path('repos/enc-overrides/enc.sh'),
58+
'--enc-override', 'role=two'
59+
]
60+
)
61+
end
62+
63+
it 'should succeed' do
64+
expect(@result.exitcode).not_to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
65+
expect(@result.exitcode).to eq(0), "Runtime error: #{@result.logs}"
66+
end
67+
68+
it 'should show no changes' do
69+
expect(@result.diffs).to eq([])
70+
end
71+
72+
it 'should contain proper resources in to-catalog' do
73+
to_catalog = @result.to
74+
expect(to_catalog).to be_a_kind_of(OctocatalogDiff::API::V1::Catalog)
75+
76+
file_one = to_catalog.resource(type: 'File', title: '/tmp/one')
77+
expect(file_one['parameters']['content']).to eq('two')
78+
79+
file_two = to_catalog.resource(type: 'File', title: '/tmp/two')
80+
expect(file_two['parameters']['content']).to eq('two')
81+
end
82+
83+
it 'should log proper messages' do
84+
expect(@result.log_messages).to include('DEBUG - ENC override message goes here')
85+
end
4986
end
5087

5188
describe 'ENC override integration with --to-enc-override' do

0 commit comments

Comments
 (0)