Re: RESTful Routes

On Feb 4, 2008 6:54 AM, Raimond G. [email protected] wrote:

NoMethodError: You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.env

Can you show the rest of the backtrace?

Sure, I’m using rspec 1.1.2, the backtrace is nice and clean, to get
the following, I commented out all the IGNORE_PATTERS, there is
probably a better way of doing it, but it worked.

 NoMethodError: You have a nil object when you didn't expect it!

The error occurred while evaluating nil.env
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/
vendor/rails/actionpack/lib/action_controller/test_process.rb:352:in
delete' ./stories/steps/blog_steps.rb:10:inthe admin clicks on ‘delete’’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
step.rb:16:in __send__' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ step.rb:16:inperform’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
world.rb:73:in store_and_call' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ world.rb:110:inWhen’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
runner/story_mediator.rb:115:in send' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ runner/story_mediator.rb:115:into_proc’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
runner/story_mediator.rb:95:in instance_eval' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ runner/story_mediator.rb:95:into_proc’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
runner/story_mediator.rb:95:in each' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ runner/story_mediator.rb:95:into_proc’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
runner/scenario_runner.rb:14:in instance_eval' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ runner/scenario_runner.rb:14:inrun’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
runner/story_runner.rb:48:in run_stories' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ runner/story_runner.rb:44:ineach’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
runner/story_runner.rb:44:in run_stories' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ runner/story_runner.rb:39:ineach’
/Users/raimondgarcia/Documents/workspace/breport.git/config/…/vendor/
plugins/rspec_on_rails/lib/spec/rails/…/…/…/…/rspec/lib/spec/story/
runner/story_runner.rb:39:in run_stories' /Users/raimondgarcia/Documents/workspace/breport.git/config/../vendor/ plugins/rspec_on_rails/lib/spec/rails/../../../../rspec/lib/spec/story/ runner.rb:46:inregister_exit_hook’
stories/user_blogs.rb:4

Thanks,

Raimond G.

On Feb 4, 2008 10:49 AM, Raimond G. [email protected] wrote:

which raises the following exception:
NoMethodError: You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.env

Can you show the rest of the backtrace?

Sure, I’m using rspec 1.1.2, the backtrace is nice and clean, to get the
following, I commented out all the IGNORE_PATTERS, there is probably a
better way of doing it, but it worked.

Sorry, but I can’t really see anything related to rspec from the
backtrace. I changed to a named route in one of my own steps and it
worked fine. Can you try doing this in a rails integration test and
see if you have a different result?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs