Forum: RSpec RSPEC book example in Chapter 3.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8e5adba4e895d68a835efbcfb03958f0?d=identicon&s=25 G. Brandon Hoyt (Guest)
on 2009-04-26 23:21
(Received via mailing list)
Hi!
I'm going through the rspec book in beta form right now and hit a snag
in chapter three.
I am developing an application in parallel to the book example instead
of writing the book example word for word.  To the best of my knowledge,
I have duplicated a parallel example of the book example, changing what
needed to be changed to fit my example.  Currently, I have a failing
spec when the book says my spec shouldn't be failing.

http://pastie.org/458945
that is the failing spec

here are my system specifications:
OS: Ubuntu 8.10_AMD64
ruby -v ruby 1.8.8p1 (2009-04-09 revision 23162) [x86_64-linux]
rspec -v rspec 1.2.4

http://pastie.org/458949
Here is the actual code that fails the spec.
any ideas?
I think I'm missing a require somewhere, that's what my gut is telling
me.
--
*******************************************************
*******************************************************
                 From G. Brandon Hoyt
                     863-397-7036
                 "Do the RIGHT thang!"
                 --Uncle Kenny

                                 de KG4GVL clear
*******************************************************
*******************************************************
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-04-27 01:07
(Received via mailing list)
On Sun, Apr 26, 2009 at 3:45 PM, G. Brandon Hoyt <qrprat77@gmail.com>
wrote:
> that is the failing spec
You've got the message expectation (should_receive) on the wrong
object - it should be on the messenger, not the program.

HTH,
David

> me.
8e5adba4e895d68a835efbcfb03958f0?d=identicon&s=25 G. Brandon Hoyt (Guest)
on 2009-04-27 05:13
(Received via mailing list)
On Sun, Apr 26, 2009 at 04:17:42PM -0500, David Chelimsky wrote:
> You've got the message expectation (should_receive) on the wrong
> object - it should be on the messenger, not the program.
>
> HTH,
> David

yep that fixed 'er all right!  I don't know ow many times I thought I
had checked it to make sure it was translated accurately, yet there it
was in plain sight!
--
--
*******************************************************
*******************************************************
**                 From G. Brandon Hoyt              **
**                     863-397-7036                  **
**                 "Do the RIGHT thang!"             **
**                 --Uncle Kenny                     **
**                                                   **
**                                 de KG4GVL clear   **
*******************************************************
*******************************************************
8f6f95c4bd64d5f10dfddfdcd03c19d6?d=identicon&s=25 Rick Denatale (rdenatale)
on 2009-04-27 16:00
(Received via mailing list)
Methinks thou shoulds't have

messenger.should_receive(:puts).with("Please make one of the following
menu selections ")

in lieu of

program.should_receive(:puts).with("Please make one of the following
menu selections ")

Sorry, I'm just in a medieval mood this afternoon for some reason.


On Sun, Apr 26, 2009 at 4:45 PM, G. Brandon Hoyt <qrprat77@gmail.com>
wrote:
> that is the failing spec
> me.
> *******************************************************
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
This topic is locked and can not be replied to.