Permalink
Browse files

rename extracted backtrace logic

  • Loading branch information...
1 parent 8db5cbe commit 4cdb8bcd411a09c906c8b2bc5019c20b7dc4c970 @JonRowe JonRowe committed Sep 9, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rspec/mocks/message_expectation.rb
@@ -26,7 +26,7 @@ def called_max_times?
end
def verify_messages_received
- BacktrackRestore.with(@backtrace_line) do
+ InsertOntoBacktrace.line(@backtrace_line) do
unless @received
@error_generator.raise_expectation_error(@message, 1, ArgumentListMatcher::MATCH_ALL, 0, nil)
end
@@ -264,7 +264,7 @@ def matches_name_but_not_args(message, *args)
# @private
def verify_messages_received
- BacktrackRestore.with(@expected_from) do
+ InsertOntoBacktrace.line(@expected_from) do
generate_error unless expected_messages_received? || failed_fast?
end
end
@@ -606,8 +606,8 @@ def cannot_modify_further_error
# Insert original locations into stacktraces
# @api private
- class BacktrackRestore
- def self.with(location)
+ class InsertOntoBacktrace
+ def self.line(location)
yield
rescue RSpec::Mocks::MockExpectationError => error
error.backtrace.insert(0, location)

0 comments on commit 4cdb8bc

Please sign in to comment.