Module RSpec::Mocks
In: lib/rspec/mocks/argument_matchers.rb
lib/rspec/mocks/mock.rb
lib/rspec/mocks/argument_list_matcher.rb
lib/rspec/mocks/order_group.rb
lib/rspec/mocks/extensions/instance_exec.rb
lib/rspec/mocks/error_generator.rb
lib/rspec/mocks/stub_chain.rb
lib/rspec/mocks/targets.rb
lib/rspec/mocks/errors.rb
lib/rspec/mocks/any_instance/expectation_chain.rb
lib/rspec/mocks/any_instance/recorder.rb
lib/rspec/mocks/any_instance/stub_chain.rb
lib/rspec/mocks/any_instance/stub_chain_chain.rb
lib/rspec/mocks/any_instance/message_chains.rb
lib/rspec/mocks/any_instance/chain.rb
lib/rspec/mocks/test_double.rb
lib/rspec/mocks/mutate_const.rb
lib/rspec/mocks/space.rb
lib/rspec/mocks/instance_method_stasher.rb
lib/rspec/mocks/example_methods.rb
lib/rspec/mocks/deprecation.rb
lib/rspec/mocks/version.rb
lib/rspec/mocks/message_expectation.rb
lib/rspec/mocks/matchers/have_received.rb
lib/rspec/mocks/matchers/receive.rb
lib/rspec/mocks/method_double.rb
lib/rspec/mocks/proxy_for_nil.rb
lib/rspec/mocks/configuration.rb
lib/rspec/mocks/syntax.rb
lib/rspec/mocks/proxy.rb
lib/rspec/mocks.rb

Methods

Included Modules

RSpec::Mocks::ExampleMethods

Classes and Modules

Module RSpec::Mocks::AnyInstance
Module RSpec::Mocks::ArgumentMatchers
Module RSpec::Mocks::Deprecation
Module RSpec::Mocks::ExampleMethods
Module RSpec::Mocks::InstanceExec
Module RSpec::Mocks::Matchers
Module RSpec::Mocks::RecursiveConstMethods
Module RSpec::Mocks::Syntax
Module RSpec::Mocks::TestDouble
Module RSpec::Mocks::Version
Class RSpec::Mocks::AllowanceTarget
Class RSpec::Mocks::AmbiguousReturnError
Class RSpec::Mocks::AndCallOriginalImplementation
Class RSpec::Mocks::AndReturnImplementation
Class RSpec::Mocks::AndYieldImplementation
Class RSpec::Mocks::AnyInstanceAllowanceTarget
Class RSpec::Mocks::AnyInstanceExpectationTarget
Class RSpec::Mocks::ArgumentListMatcher
Class RSpec::Mocks::Configuration
Class RSpec::Mocks::Constant
Class RSpec::Mocks::ConstantMutator
Class RSpec::Mocks::ErrorGenerator
Class RSpec::Mocks::ExpectationTarget
Class RSpec::Mocks::Implementation
Class RSpec::Mocks::InstanceMethodStasher
Class RSpec::Mocks::MessageExpectation
Class RSpec::Mocks::MethodDouble
Class RSpec::Mocks::Mock
Class RSpec::Mocks::MockExpectationError
Class RSpec::Mocks::OrderGroup
Class RSpec::Mocks::Proxy
Class RSpec::Mocks::ProxyForNil
Class RSpec::Mocks::Space
Class RSpec::Mocks::StubChain
Class RSpec::Mocks::TargetBase

Constants

UnsupportedMatcherError = Class.new(StandardError)
NegationUnsupportedError = Class.new(StandardError)
ConstantStubber = ConstantMutator   Keeps backwards compatibility since we had released an rspec-mocks that only supported stubbing. Later, we released the hide_const feature and decided that the term "mutator" was a better term to wrap up the concept of both stubbing and hiding.
KERNEL_METHOD_METHOD = ::Kernel.instance_method(:method)   @api private
IGNORED_BACKTRACE_LINE = 'this backtrace line is ignored'   @private

Attributes

space  [RW] 

Public Class methods

Adds an allowance (stub) on `subject`

@param subject the subject to which the message will be added @param message a symbol, representing the message that will be

               added.

@param opts a hash of options, :expected_from is used to set the

            original call site

@param block an optional implementation for the allowance

@example Defines the implementation of `foo` on `bar`, using the passed block

  x = 0
  RSpec::Mocks.allow_message(bar, :foo) { x += 1 }

Sets a message expectation on `subject`. @param subject the subject on which the message will be expected @param message a symbol, representing the message that will be

               expected.

@param opts a hash of options, :expected_from is used to set the

            original call site

@param block an optional implementation for the expectation

@example Expect the message `foo` to receive `bar`, then call it

  RSpec::Mocks.expect_message(bar, :foo)
  bar.foo

@api private Used internally to get a method handle for a particular object and method name.

Includes handling for a few special cases:

  - Objects that redefine #method (e.g. an HTTPRequest struct)
  - BasicObject subclasses that mixin a Kernel dup (e.g. SimpleDelegator)

[Validate]