[rspec-users] rspec on rails: undefined method 'controller_name'

Perryn Fowler pezlists at gmail.com
Thu Apr 12 04:12:23 EDT 2007


Im trying to write a controller spec, but when I run it I get an error like
the one below.

I found  Bug6707
(http://rubyforge.org/pipermail/rspec-devel/2007-March/002147.html
), but I get the error no matter how I run the spec
( whether I use rake or not)

Any ideas?

I am using 0.8.2

The Error:

C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectati

ons/sugar.rb:14:in `call': undefined method `controller_name' for
#<Spec::Runner
::ContextEvalModule:0x35e6a98> (NoMethodError)
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec- 0.8.2
/lib/s
pec/expectations/sugar.rb:14:in `_method_missing'
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.8.2
/lib/s
pec/expectations/sugar.rb:10:in `method_missing'
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec- 0.8.2
/lib/s
pec/runner/context_eval.rb:47:in `method_missing'
        from ./spec/functional/booking_sheet_spec.rb:4
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.8.2
/lib/s
pec/runner/context.rb:14:in `class_eval'
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.8.2
/lib/s
pec/runner/context.rb:14:in `initialize'
        from
C:/dev/teetime/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/
context_factory.rb:37:in `new'
        from
C:/dev/teetime/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/
context_factory.rb:37:in `create'
        from
C:/dev/teetime/vendor/plugins/rspec_on_rails/lib/spec/rails/extensi
ons/kernel.rb:4:in `context'
        from ./spec/functional/booking_sheet_spec.rb:3
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.8.2
/lib/s
pec/runner/command_line.rb:24:in `load'
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec- 0.8.2
/lib/s
pec/runner/command_line.rb:24:in `run'
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.8.2
/lib/s
pec/runner/command_line.rb:18:in `each'
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec- 0.8.2
/lib/s
pec/runner/command_line.rb:18:in `run'
        from C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.8.2
/bin/s
pec:4
        from C:/rails/InstantRails/ruby/bin/spec:18:in `load'
        from C:/rails/InstantRails/ruby/bin/spec:18


-- 
-----------------------
Perryn Fowler
ThoughtWorks

-- 
-----------------------
Perryn Fowler
ThoughtWorks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070412/1a73ff0f/attachment.html 


More information about the rspec-users mailing list