Does shoulda support ".should ==" syntax

2 views
Skip to first unread message

nick

unread,
Dec 31, 2009, 11:59:58 AM12/31/09
to shoulda
Does shoulda support a syntax like this:

should "return weekly hours" do
hours = @project.recent_weekly_hours
hours.size.should == 52
end

I was expecting it to - and thought I had seen it somewhere - but I
get "undefined method 'should' "

thanks
nick

Ryan Angilly

unread,
Dec 31, 2009, 12:09:26 PM12/31/09
to sho...@googlegroups.com
I believe that's rspec, not shoulda.

--
Individuals over processes. Interactions over tools.

Agile Rails training from thoughtbot, the makers of Clearance, Shoulda, & Factory Girl:
http://thoughtbot.com/services/training

The Shoulda group:
http://groups.google.com/group/shoulda

To post to this group, send email to
sho...@googlegroups.com

To unsubscribe from this group, send email to
shoulda+u...@googlegroups.com

nick

unread,
Jan 1, 2010, 5:20:54 AM1/1/10
to shoulda
Yes, you're right. It is in rspec and not shoulda. Shame cos it's a
nice way to write tests.
Thanks
Nick

Bill Kirtley

unread,
Jan 3, 2010, 10:49:34 AM1/3/10
to sho...@googlegroups.com
Use test/spec for that nice syntax: http://test-spec.rubyforge.org/test-spec/


--

Josh Nichols

unread,
Jan 8, 2010, 4:11:45 PM1/8/10
to sho...@googlegroups.com
You can get that effect by using matchy: http://github.com/jeremymcanally/matchy

I think John Nunemaker use this combo in some of his railstips.org posts and his libraries, so you may have seen it there.

- Josh

On Thu, Dec 31, 2009 at 11:59 AM, nick <nick.mc...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages