123456789_123456789_123456789_123456789_123456789_

Module: RSpec::Core::MockingAdapters::RSpec Private

Do not use. This module is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
Defined in: rspec-core/lib/rspec/core/mocking_adapters/rspec.rb

Class Method Summary

Instance Method Summary

::RSpec::Mocks::ExampleMethods - Included

#allow

Used to wrap an object in preparation for stubbing a method on it.

#allow_any_instance_of

Used to wrap a class in preparation for stubbing a method on instances of it.

#allow_message_expectations_on_nil

Disables warning messages about expectations being set on nil.

#class_double

Constructs a test double against a specific class.

#class_spy

Constructs a test double that is optimized for use with ‘have_received` against a specific class.

#double

Constructs an instance of [RSpec::Mocks::Double](RSpec::Mocks::Double) configured with an optional name, used for reporting in failure messages, and an optional hash of message/return-value pairs.

#expect

Used to wrap an object in preparation for setting a mock expectation on it.

#expect_any_instance_of

Used to wrap a class in preparation for setting a mock expectation on instances of it.

#have_received

Verifies that the given object received the expected message during the course of the test.

#hide_const

Hides the named constant with the given value.

#instance_double

Constructs a test double against a specific class.

#instance_spy

Constructs a test double that is optimized for use with ‘have_received` against a specific class.

#object_double

Constructs a test double against a specific object.

#object_spy

Constructs a test double that is optimized for use with ‘have_received` against a specific object.

#receive

Used to specify a message that you expect or allow an object to receive.

#receive_message_chain

stubs/mocks a chain of messages on an object or test double.

#receive_messages

Shorthand syntax used to setup message(s), and their return value(s), that you expect or allow an object to receive.

#spy

Constructs a test double that is optimized for use with ‘have_received`.

#stub_const

Stubs the named constant with the given value.

#without_partial_double_verification

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.

::RSpec::Mocks::ArgumentMatchers - Included

#a_kind_of
#an_instance_of
#any_args

Acts like an arg splat, matching any number of args at any point in an arg list.

#anything

Matches any argument at all.

#array_excluding

Matches an array that excludes the specified items.

#array_including

Matches an array that includes the specified items at least once.

#boolean

Matches a boolean value.

#duck_type

Matches if the actual argument responds to the specified messages.

#hash_excluding

Matches a hash that doesn’t include the specified key(s) or key/value.

#hash_including

Matches a hash that includes the specified key(s) or key/value pairs.

#hash_not_including
#instance_of

Matches if ‘arg.instance_of?(klass)`.

#kind_of

Matches if ‘arg.kind_of?(klass)`.

#no_args

Matches no arguments.

Class Method Details

.configuration

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/mocking_adapters/rspec.rb', line 14

def self.configuration
  ::RSpec::Mocks.configuration
end

.framework_name

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/mocking_adapters/rspec.rb', line 10

def self.framework_name
  :rspec
end

Instance Method Details

#setup_mocks_for_rspec

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/mocking_adapters/rspec.rb', line 18

def setup_mocks_for_rspec
  ::RSpec::Mocks.setup
end

#teardown_mocks_for_rspec

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/mocking_adapters/rspec.rb', line 26

def teardown_mocks_for_rspec
  ::RSpec::Mocks.teardown
end

#verify_mocks_for_rspec

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/mocking_adapters/rspec.rb', line 22

def verify_mocks_for_rspec
  ::RSpec::Mocks.verify
end