Skip to content

Commit

Permalink
[expectations] Merge pull request rspec/rspec-expectations#1295 from …
Browse files Browse the repository at this point in the history
…rspec/fix-support-for-dynamic-matchers-4-0-dev

Fix support for dynamic matchers

---
This commit was imported from rspec/rspec-expectations@33f177c.
  • Loading branch information
pirj authored Mar 5, 2021
2 parents 9142659 + 3988e9f commit bd58fe8
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ def enforce_value_expectation(matcher)
end

def supports_value_expectations?(matcher)
matcher.supports_value_expectations?
rescue NoMethodError
true
!matcher.respond_to?(:supports_value_expectations?) || matcher.supports_value_expectations?
end
end

Expand Down Expand Up @@ -155,9 +153,7 @@ def enforce_block_expectation(matcher)
end

def supports_block_expectations?(matcher)
matcher.supports_block_expectations?
rescue NoMethodError
false
matcher.respond_to?(:supports_block_expectations?) && matcher.supports_block_expectations?
end
end
end
Expand Down

0 comments on commit bd58fe8

Please sign in to comment.