Groups
Groups
Sign in
Groups
Groups
rspec
Conversations
About
Send feedback
Help
[rspec-users] STDOUT.should_receive(:puts).with Works *** (:print) fails
28 views
Skip to first unread message
Charles Thornton
unread,
May 10, 2013, 11:36:43 PM
5/10/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rspec...@rubyforge.org
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:
ad...@hawthorne-press.com
--
Posted via
http://www.ruby-forum.com/
.
_______________________________________________
rspec-users mailing list
rspec...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Bas Vodde
unread,
May 11, 2013, 2:34:34 AM
5/11/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rspec...@rubyforge.org
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
Reply all
Reply to author
Forward
0 new messages