On Tue, Dec 14, 2010 at 4:26 PM, Marnen Laibow-Koser
<[email protected]>wrote:
> David Kahn wrote in post #968428:
> > Curious if anyone has Shoulda working with test/unit in Rails 3. I tried
> > it
> > this morning and am getting:
> >
> > test/unit/practice_member_test.rb:4:in `<class:PracticeMemberTest>':
> > undefined method `context' for PracticeMemberTest:Class (NoMethodError)
> >
> > Now, I have a Rails 3 project with Rspec including Shoulda also and it
> > works
> > fine. I tried placing "require 'shoulda'" in test helper to no avail,
> > but
> > when I run the debugger and type Shoulda, the object is found.
>
> What's the point of using RSpec and Shoulda together? I thought all
> Shoulda did was give an RSpec-like syntax to Test::Unit.
>
> Come to think of it, what's the point of using Shoulda (instead of
> RSpec) at all?
>
Well,
I like that I can include it in Test/Unit.
Not really into the .should and the argument that it makes tests readable...
just does not feel necessary to me.
I like the "should ....." vs "argument.should be_nil" or the like. Just
reads better to me.
One less DSL to use (arguably)
One of the things I really like in Shoulda that I have seen so far are the
matchers... things like:
it { should belong_to(:contact) }
it { should have_many(:addresses) }
it { should validate_presence_of(:address) }
it { should allow_value('55416').for(:zip) }
it { should_not allow_value('554316').for(:zip) }
I think these are very cool... and save a lot of time. This is what made me
look into shoulda. Does Rspec have these/similar?
I think the documentation is better for Shoulda, not that this means
everything but is important.
And Shoulda gives me what I consider the best feature of Rspec - the
grouping syntax (describe... it ....).... that is the one thing to date that
I felt I would miss of empirical value by not using Rspec.
So why not? What am I missing?
>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> [email protected]
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.