Class/Module Index [+]

Quicksearch

RSpec::Mocks

Constants

ConstantStubber

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

@api private

Attributes

space[RW]

Public Class Methods

configuration() click to toggle source
# File lib/rspec/mocks.rb, line 26
def configuration
  @configuration ||= Configuration.new
end
method_handle_for(object, method_name) click to toggle source

@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)
# File lib/rspec/mocks.rb, line 49
def method_handle_for(object, method_name)
  if ::Kernel === object
    KERNEL_METHOD_METHOD.bind(object).call(method_name)
  else
    object.method(method_name)
  end
end
setup(host) click to toggle source
# File lib/rspec/mocks.rb, line 10
def setup(host)
  add_extensions unless extensions_added?
  (class << host; self; end).class_eval do
    include RSpec::Mocks::ExampleMethods
  end
  self.space ||= RSpec::Mocks::Space.new
end
teardown() click to toggle source
# File lib/rspec/mocks.rb, line 22
def teardown
  space.reset_all
end
verify() click to toggle source
# File lib/rspec/mocks.rb, line 18
def verify
  space.verify_all
end
warn_deprecation(message) click to toggle source

@api private Used internally by RSpec to display custom deprecation warnings. This is also defined in rspec-core, but we can't assume it's loaded since rspec-expectations should be usable w/o rspec-core.

# File lib/rspec/mocks.rb, line 34
def warn_deprecation(message)
  warn(message)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.