Skip to content

Commit

Permalink
rename config method to better reflect its purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Nov 10, 2016
1 parent 2ca10c7 commit bea81b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/rspec/mocks/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def initialize
@verify_doubled_constant_names = false
@transfer_nested_constants = false
@verify_partial_doubles = false
@temporarily_suppressing_verification = false
@temporarily_suppressing_partial_double_verification = false
end

# Sets whether RSpec will warn, ignore, or fail a test when
Expand Down Expand Up @@ -155,9 +155,9 @@ def verify_partial_doubles?
end

# @private
# Used to track wether we are temporarily suppressing verifying doubles
# with `without_verifying_partial_doubles { ... }`
attr_accessor :temporarily_suppressing_verification
# Used to track wether we are temporarily suppressing verifying partial
# doubles with `without_verifying_partial_doubles { ... }`
attr_accessor :temporarily_suppressing_partial_double_verification

if ::RSpec.respond_to?(:configuration)
def color?
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/mocks/example_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ def have_received(method_name, &block)
# time and you wish to define stubs for them but not turn off partial
# doubles for the entire run suite. (e.g. view specs in rspec-rails).
def without_verifying_partial_doubles
Mocks.configuration.temporarily_suppressing_verification = true
Mocks.configuration.temporarily_suppressing_partial_double_verification = true
yield
ensure
Mocks.configuration.temporarily_suppressing_verification = false
Mocks.configuration.temporarily_suppressing_partial_double_verification = false
end

# @method expect
Expand Down
6 changes: 3 additions & 3 deletions lib/rspec/mocks/verifying_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def add_message_expectation(method_name, opts={}, &block)
end

def ensure_implemented(method_name)
return if Mocks.configuration.temporarily_suppressing_verification
return if Mocks.configuration.temporarily_suppressing_partial_double_verification
return unless method_reference[method_name].unimplemented?

@error_generator.raise_unimplemented_error(
Expand All @@ -47,7 +47,7 @@ def ensure_implemented(method_name)
end

def ensure_publicly_implemented(method_name, _object)
return if Mocks.configuration.temporarily_suppressing_verification
return if Mocks.configuration.temporarily_suppressing_partial_double_verification
ensure_implemented(method_name)
visibility = method_reference[method_name].visibility

Expand Down Expand Up @@ -195,7 +195,7 @@ def unimplemented?
def self.for(object, method_name, proxy)
if ClassNewMethodReference.applies_to?(method_name) { object }
VerifyingExistingClassNewMethodDouble
elsif Mocks.configuration.temporarily_suppressing_verification
elsif Mocks.configuration.temporarily_suppressing_partial_double_verification
MethodDouble
else
self
Expand Down

0 comments on commit bea81b9

Please sign in to comment.