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.
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 withit { 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 withit { should contain_file('blah').with_content(sensitive(%r{regexp for interesting line})) }
. Well, with these changes - you can.