Controller tests and explicit subject

27 views
Skip to first unread message

ericindc

unread,
Jun 27, 2010, 9:19:18 PM6/27/10
to shoulda
I am trying to understand these errors (http://pastie.org/1020788) and
have traced it down to needing to explicitly specify subject
{ controller }. I looked at the controller test examples in the
Shoulda docs and see no need for specifying the subject there, but
it's the only way I've managed to get the tests working thus far. Any
advice? Thanks.


# Subject not explicitly set
#<Proc:0x0000000101231f48@/Users/Eric/.rvm/gems/ruby-1.8.7-p249@a8/
gems/rspec-core-2.0.0.beta.13/lib/rspec/core/subject.rb:72>

# subject { controller }
#<Proc:0x00000001010226d0@/Users/Eric/Development/Alien8Labs/
alien8labs.com/spec/controllers/homepage_controller_spec.rb:14>

Curran Schiefelbein

unread,
Jun 28, 2010, 12:24:45 PM6/28/10
to sho...@googlegroups.com
It looks like your error's coming out of RSpec, not Shoulda. I'm not
familiar with RSpec, so can't confirm that's how it works, but you
might try the documentation for that instead.

Shoulda doesn't require RSpec, so its test examples needn't specify a subject.

Curran

> --
> 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

ericindc

unread,
Jul 1, 2010, 9:41:17 PM7/1/10
to shoulda
I'm pretty sure there is something up with my Shoulda configuration.
I'm having the same issues in my model tests, where none of the
shoulda matchers are recognized. Is there documentation somewhere on
the specifics of configuring Shoulds + RSpec + Rails 3?

On Jun 28, 12:24 pm, Curran Schiefelbein <c.schiefelb...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages