rodjek / rspec-puppet

RSpec tests for your Puppet manifests
http://rspec-puppet.com
MIT License
364 stars 203 forks source link

Added support for regexp arguments to Sensitive #823

Closed tiandrey closed 3 years ago

tiandrey commented 3 years ago

Sometimes we have big configuration files created from templates. Sometimes we test its contents in our unit tests. When file content is just string (content => template('blah/blah.erb')), it's easy to test only one line with it { should contain_file('blah').with_content(%r{regexp for interesting line}) }. However, if we change file content to Sensitive (content => Sensitive(template('blah/blah.erb'))), it becomes impossible to test contents without specifying whole contents - you can't test it with it { should contain_file('blah').with_content(sensitive(%r{regexp for interesting line})) }. Well, with these changes - you can.

tiandrey commented 3 years ago

Sure. Looks green now, thanks for fixing that annoying CI failure.