[rspec-users] getting output of STDOUT in spec

aslak hellesoy aslak.hellesoy at gmail.com
Tue Apr 10 08:21:06 EDT 2007


On 4/10/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
>
> Consider the following method:
>
> def name_to_terminal
>    puts "Scott Taylor"
> end
>
> How would I spec this out?
>

def name_to_terminal(io=STDOUT)
  io.puts "Scott Taylor"
end

then call it from a spec passing in a mock for io with the appropriate
expectation


> Scott
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list