Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit eebc91e

Browse files
committed
fixup! Extract to a method
1 parent 2403584 commit eebc91e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/rspec/core/memoized_helpers.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,7 @@ def __init_memoized
148148

149149
# @private
150150
def enforce_value_expectation(matcher, method_name)
151-
matcher_supports_value_expectations = begin
152-
matcher.supports_value_expectations?
153-
rescue
154-
true
155-
end
156-
return if matcher_supports_value_expectations
151+
return if matcher_supports_value_expectations?
157152

158153
RSpec.deprecate(
159154
"#{method_name} #{RSpec::Support::ObjectFormatter.format(matcher)}",
@@ -165,6 +160,12 @@ def enforce_value_expectation(matcher, method_name)
165160
)
166161
end
167162

163+
def matcher_supports_value_expectations?
164+
matcher.supports_value_expectations?
165+
rescue
166+
true
167+
end
168+
168169
# @private
169170
class ThreadsafeMemoized
170171
def initialize

0 commit comments

Comments
 (0)