Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: f11203d233
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (15 sloc) 0.465 kB

rspec-mocks-2.6

any_instance

Set method stubs and message expectations on any instance of a class:

class Foo; end
Foo.any_instance.stub(:bar) { 'bar' }
Foo.new.bar # => 'bar'

rspec-mocks-2.2

require "rspec/mocks/standalone"

Sets up top-level environment to explore rspec-mocks. Mostly useful in irb:

$ irb
> require 'rspec/mocks/standalone'
> foo = double()
> foo.stub(:bar) { :baz }
> foo.bar
  => :baz
Jump to Line
Something went wrong with that request. Please try again.