mirror of
https://github.com/inspec/inspec
synced 2025-02-16 22:18:38 +00:00
fail with warning, if users use contain matcher
This commit is contained in:
parent
a199796b5e
commit
25783ea283
2 changed files with 8 additions and 1 deletions
|
@ -421,7 +421,7 @@ The ``content`` matcher tests if contents in the file that defines the bonded ne
|
|||
|
||||
.. code-block:: ruby
|
||||
|
||||
its('content') { should contain 'value' }
|
||||
its('content') { should match('value') }
|
||||
|
||||
exist -- DONE
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
|
|
@ -212,3 +212,10 @@ RSpec::Matchers.define :have_rule do |rule|
|
|||
fail "[UNSUPPORTED] `with_table` is not supported in combination with `with_chain`. Please use the following syntax `iptables(table:'mangle', chain: 'input')`."
|
||||
end
|
||||
end
|
||||
|
||||
# unsupported
|
||||
RSpec::Matchers.define :contain do |_rule|
|
||||
match do |_resource|
|
||||
fail "[UNSUPPORTED] `contain` matcher. Please use the following syntax `its('content') { should match('value') }`."
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue