Skip to content

Commit

Permalink
remove unless stubbing_method_unnecessarily allow check
Browse files Browse the repository at this point in the history
... the check is redundant as the check method already returns
early/does nothing if the action is allowed
  • Loading branch information
nitishr committed Dec 26, 2019
1 parent acadb30 commit 7595826
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/mocha/mockery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@ def verify(assertion_counter = nil)
backtrace = unsatisfied_expectations.empty? ? caller : unsatisfied_expectations[0].backtrace
raise ExpectationErrorFactory.build("not all expectations were satisfied\n#{mocha_inspect}", backtrace)
end
unless Mocha.configuration.stubbing_method_unnecessarily == :allow
expectations.reject(&:used?).each do |e|
check(:stubbing_method_unnecessarily, 'method unnecessarily', e.method_signature, e.backtrace)
end
expectations.reject(&:used?).each do |e|
check(:stubbing_method_unnecessarily, 'method unnecessarily', e.method_signature, e.backtrace)
end
end

Expand Down

0 comments on commit 7595826

Please sign in to comment.