Methods

Files

Mocha::ClassMethods

Methods added all classes to allow mocking and stubbing on real objects.

Public Instance Methods

any_instance → mock object click to toggle source

Returns a mock object which will detect calls to any instance of this class.

  Product.any_instance.stubs(:save).returns(false)
  product_1 = Product.new
  assert_equal false, product_1.save
  product_2 = Product.new
  assert_equal false, product_2.save
     # File lib/mocha/object.rb, line 169
169:     def any_instance
170:       @any_instance ||= AnyInstance.new(self)
171:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.