# STDOUT.should\_receive(:puts).with Works \*\*\* (:print) fails

**URL:** <https://www.ruby-forum.com/t/stdout-should-receive-puts-with-works-print-fails/228882>\
**Category:** RSpec\
**Created:** [May 11, 2013, 5:36am UTC](https://www.ruby-forum.com/t/stdout-should-receive-puts-with-works-print-fails/228882 "2013-05-11T05:36:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![godfather667](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@godfather667](https://www.ruby-forum.com/u/godfather667)\
**Post date:** [May 11, 2013, 5:36am UTC](https://www.ruby-forum.com/t/stdout-should-receive-puts-with-works-print-fails/228882/1 "2013-05-11T05:36:43Z")

</div>

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: removed\_email\_address@domain.invalid
