Module: RSpec::Mocks

Defined in:
lib/rspec/mocks.rb,
lib/rspec/mocks/mock.rb,
lib/rspec/mocks/proxy.rb,
lib/rspec/mocks/space.rb,
lib/rspec/mocks/errors.rb,
lib/rspec/mocks/methods.rb,
lib/rspec/mocks/version.rb,
lib/rspec/mocks/order_group.rb,
lib/rspec/mocks/spec_methods.rb,
lib/rspec/mocks/method_double.rb,
lib/rspec/mocks/serialization.rb,
lib/rspec/mocks/error_generator.rb,
lib/rspec/mocks/argument_matchers.rb,
lib/rspec/mocks/message_expectation.rb,
lib/rspec/mocks/argument_expectation.rb,
lib/rspec/mocks/extensions/instance_exec.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ArgumentMatchers, ExampleMethods, InstanceExec, Methods, Serialization, Version Classes: AmbiguousReturnError, ArgumentExpectation, BaseExpectation, ErrorGenerator, MessageExpectation, MethodDouble, Mock, MockExpectationError, NegativeMessageExpectation, OrderGroup, Proxy, Space

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.spaceObject

Returns the value of attribute space.



177
178
179
# File 'lib/rspec/mocks.rb', line 177

def space
  @space
end

Class Method Details

.setup(includer) ⇒ Object



179
180
181
182
183
184
185
# File 'lib/rspec/mocks.rb', line 179

def setup(includer)
  Object.class_eval { include RSpec::Mocks::Methods } unless Object < RSpec::Mocks::Methods
  (class << includer; self; end).class_eval do
    include RSpec::Mocks::ExampleMethods
  end
  self.space ||= RSpec::Mocks::Space.new
end

.teardownObject



191
192
193
# File 'lib/rspec/mocks.rb', line 191

def teardown
  space.reset_all
end

.verifyObject



187
188
189
# File 'lib/rspec/mocks.rb', line 187

def verify
  space.verify_all
end