Method: RSpec::Mocks::ExampleMethods#without_partial_double_verification

Defined in:
lib/rspec/mocks/example_methods.rb

#without_partial_double_verificationObject

Turns off the verifying of partial doubles for the duration of the block, this is useful in situations where methods are defined at run 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).



289
290
291
292
293
294
295
# File 'lib/rspec/mocks/example_methods.rb', line 289

def without_partial_double_verification
  original_state = Mocks.configuration.temporarily_suppress_partial_double_verification
  Mocks.configuration.temporarily_suppress_partial_double_verification = true
  yield
ensure
  Mocks.configuration.temporarily_suppress_partial_double_verification = original_state
end