[rspec-devel] rake aborted! when setting expectations in before

David Chelimsky dchelimsky at gmail.com
Tue Oct 9 00:32:30 EDT 2007


Thanks - sadly that doesn't tell me much.

You said you think it's because you're setting expectations
before(:each) example. Have you tried moving this line:

User.should_receive(:new)

directly into the examples? Different result?

Also - the expectation is that User.should_receive(:new), but it
doesn't return anything - so I wonder what's going in in the code.
Would you mind posting the full spec and code? At least the failing
spec (w/ before, etc) and the action it is going after.

Thanks,
David

On 10/8/07, Mark Van Holstyn <mvanholstyn at gmail.com> wrote:
>
>
> On 10/8/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> > versions? rspec?
>
> trunk
>
> > rails?
>
> trunk
>
> > os?
>
> OS X 10.4
>
> > run "rake spec --trace" and copy the output pls
>
> $ rake spec:controllers --trace
> ** Invoke spec:controllers (first_time)
> ** Invoke db:test:prepare (first_time)
> ** Invoke environment (first_time)
> ** Execute environment
> ** Execute db:test:prepare
> ** Invoke db:test:clone (first_time)
> ** Invoke db:schema:dump (first_time)
> ** Invoke environment
> ** Execute db:schema:dump
> ** Invoke db:test:purge (first_time)
> ** Invoke environment
> ** Execute db:test:purge
> ** Execute db:test:clone
> ** Invoke db:schema:load (first_time)
> ** Invoke environment
> ** Execute db:schema:load
> ** Execute spec:controllers
> P................................................................................................................P.......P...................
>
> Pending:
> UsersController redirect after login needs to be tested (Not Yet
> Implemented)
> DesignsController#index with view_designs privilege should pull
> design_search from the session if it already exists (Not Yet Implemented)
> DesignsController#index with crud_designs privilege should pull
> design_search from the session if it already exists (Not Yet Implemented)
>
> Finished in 0.939632 seconds
>
> 141 examples, 0 failures, 3 pending
>  rake aborted!
> Command ruby -I"~/project/vendor/plugins/rspec/lib"
> "~/project/vendor/plugins/rspec/bin/spec"
> "spec/controllers/agencies_controller_spec.rb"
> "spec/controllers/designs_controller_spec.rb"
> "spec/controllers/projects_controller_spec.rb"
> "spec/controllers/users_controller_spec.rb" --options
> "~/project/spec/spec.opts" failed
> ~/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:173:in
> `define'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:823:in
> `verbose'
> ~/project/vendor/plugins/rspec/lib/spec/rake/spectask.rb:142:in
> `define'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in
> `call'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in
> `execute'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in
> `each'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in
> `execute'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in
> `invoke'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in
> `synchronize'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in
> `invoke'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in
> `top_level'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in
> `each'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in
> `top_level'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
> `standard_exception_handling'
> /opt/local/lib/ruby/gems/1.8/gems/rake-
> 0.7.3/lib/rake.rb:1733:in `top_level'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in
> `run'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
> `standard_exception_handling'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in
> `run'
> /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7
> /opt/local/bin/rake:16:in `load'
> /opt/local/bin/rake:16
>
>
> --
>
> Mark Van Holstyn, Partner / Software Developer
> mvanholstyn at mutuallyhuman.com, (616) 706-6842
> Mutually Human Software, http://mutuallyhuman.com
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the rspec-devel mailing list