Charles Thornton
2013-May-11 03:36 UTC
[rspec-users] STDOUT.should_receive(:puts).with Works *** (:print) fails
I use: STDOUT.should_receive(:puts).with...... many times in RSPEC However, I have a couple of "do you want(Y/N)?" where I use ''print'' and apparently ..(:print).with... does not work. I can change ''print'' to ''puts'' and it works perfectly. How do I test :print and ...getch("y") for input??? Any help would be appreciated!! Chuck T. EMAIL: admin at hawthorne-press.com -- Posted via http://www.ruby-forum.com/.
Bas Vodde
2013-May-11 06:34 UTC
[rspec-users] STDOUT.should_receive(:puts).with Works *** (:print) fails
Hi Chuck, If you just call "print" and "getch" then you should be able to test for these by checking for these messages on your object under test: subject.should_receive(:print) Hope that helps? Bas On 11 May, 2013, at 11:36 AM, Charles Thornton <lists at ruby-forum.com> wrote:> I use: STDOUT.should_receive(:puts).with...... many times in RSPEC > > However, I have a couple of "do you want(Y/N)?" where I use ''print'' > > and apparently ..(:print).with... does not work. I can change ''print'' > to ''puts'' and it works perfectly. > > How do I test :print and ...getch("y") for input??? > > Any help would be appreciated!! > > Chuck T. > > EMAIL: admin at hawthorne-press.com > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users