method
puts
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
Register or
log in
to add new notes.
ruuzo -
October 23, 2008
![Default_avatar_30](https://www.gravatar.com/avatar/fb7a1296f5441663b199d16849d50df2?default=http://apidock.com/images/default_avatar_30.png&size=30)
1 thank
Mocking puts from RSpec
If you want to mock calls to puts from RSpec, do it from the class/module you are in:
module Foo def self.foo puts "hello" end end describe Foo do it "should write 'hello' when foo() is called" do Foo.should_receive(:puts).with("hello") # Kernel and Object don't work in this case... Foo.foo end end