fail with warning, if users use contain matcher

This commit is contained in:
Christoph Hartmann 2015-10-23 23:24:00 +02:00
parent a199796b5e
commit 25783ea283
2 changed files with 8 additions and 1 deletions

View file

@ -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
+++++++++++++++++++++++++++++++++++++++++++++++++++++

View file

@ -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