Fixed tests to work with rspec-expectations 3.8.5+.

We were using a "private" method in our tests and they changed the
signature.

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2019-10-02 18:08:19 -07:00
parent ba003ed529
commit 708a319ce8

View file

@ -14,9 +14,17 @@ describe "inspec matchers" do
#
# expect(expression).to be expected_value
if ::RSpec::Expectations::ExpectationTarget.method(:for).arity == 1
# rspec-expectations 3.8.5+
def rspec_expect(value, &block)
::RSpec::Expectations::ExpectationTarget.for(value, &block)
end
else
# rspec-expectations 3.8.4-
def rspec_expect(value, &block)
::RSpec::Expectations::ExpectationTarget.for(value, block)
end
end
##
# Assert using the `cmp` matcher.