Parent

Included Modules

Facon::Mock

A mock object is a 'fake' object on which you can impose simulated behavior. Defining expectations and stubs on mock objects allows you to specify object collaboration without needing to actually instantiate those collaborative objects.

Examples

mock = mock('A name')
mock = mock('Mock person', :name => 'Konata', :sex => 'female')

Attributes

name[RW]

Public Class Methods

new(name, stubs = {}) click to toggle source
# File lib/facon/mock.rb, line 20
def initialize(name, stubs = {})
  @name = name
  stub_out(stubs)
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
# File lib/facon/mock.rb, line 25
def method_missing(method, *args, &block)
  super(method, *args, &block)
rescue NameError
  # An unexpected method was called on this mock.
  mock_proxy.raise_unexpected_message_error(method, *args)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.