Skip to content

Commit 61369b4

Browse files
committed
Add a test for ENC regexp with ::
1 parent 28c4c5b commit 61369b4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/octocatalog-diff/tests/catalog-util/enc_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,19 @@
167167
logs = @logger_str.string.split(/\n/).compact.map { |x| OctocatalogDiff::Spec.strip_log_message(x) }
168168
expect(logs).to include('DEBUG - ENC override: foo = "bar"')
169169
end
170+
171+
it 'should not error if ENC regexp has ::s' do
172+
options = {
173+
enc_override: [OctocatalogDiff::API::V1::Override.create_from_input('/parameters::o+/=(string)bar')]
174+
}
175+
subject = described_class.allocate
176+
subject.instance_variable_set('@options', options)
177+
subject.instance_variable_set('@content', "---\nparameters:\n foo: baz\n fizz: buzz\n")
178+
subject.send(:override_enc_parameters, @logger)
179+
expect(subject.instance_variable_get('@content')).to eq("---\nparameters:\n foo: baz\n fizz: buzz\n")
180+
logs = @logger_str.string.split(/\n/).compact.map { |x| OctocatalogDiff::Spec.strip_log_message(x) }
181+
expect(logs).not_to match(/DEBUG - ENC override/)
182+
end
170183
end
171184

172185
describe '#merge_enc_param' do

0 commit comments

Comments
 (0)