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/any_instance.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: AnyInstance, 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
186
# File 'lib/rspec/mocks.rb', line 179

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

.teardownObject



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

def teardown
  space.reset_all
end

.verifyObject



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

def verify
  space.verify_all
end