addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1light-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [ruby-81] I could use a little help with some BDD / rpspec concepts.

From: Elliott B.
Sent on: Monday, March 31, 2008 9:05 AM
William,

Thank you for your detailed reply. ?I'd be curious to know what resources you used to learn your rspec chops?

Best,
Elliott
?


----- Original Message ----
From: William Sobel <[address removed]>
To: [address removed]
Sent: Sunday, March 30,[masked]:00:28 AM
Subject: Re: [ruby-81] I could use a little help with some BDD / rpspec concepts.


@comment = mock_model(Comment)
@comments = [@comment]
comments_proxy = mock(Array)

# Make sure the post receives comments
@post.should_receive(:comments).and_return(comments_proxy)

# Assuming there is a current user mock available.
comments_proxy.should_receive(:find).with(:conditions => ['user_id = ?', @current_user]).and_return(@comments)

Then it will tell you if it those objects never received those methods.

Cheers,
- Will





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by William Sobel ([address removed]) from The East Bay Ruby Meetup Group.
To learn more about William Sobel, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup.com Customer Service: [address removed]
632 Broadway New York NY 10012 USA



OMG, Sweet deal for Yahoo! users/friends: Get A Month of Blockbuster Total Access, No Cost. W00t

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy