[rspec-users] problem running tests of helpers

Art Peel apeel3 at gmail.com
Wed Mar 23 21:01:59 EDT 2011


I'm in the process of upgrading from ruby 1.8.7 to ruby-1.9.2-p18  and from
rails 2.3.8 to rails 2.3.9 and my tests of helpers have stopped working, for
example script/spec spec/helpers/application_helper_spec.rb  (Full sample
shown below.)

The output is below.  The problem occurs in helper_example_group.rb when
trying
@controller.request = @request

I have not been able to figure out why @controller is nil.

A minimal rails project that reproduces the problem is available at
https://github.com/whenceforth/Helper-Test-Fail-Project

I'm using bundler.

script/spec --version
rspec 1.3.1

which ruby
/Users/art/.rvm/rubies/ruby-1.9.2-p180/bin/ruby

Thanks in advance for any pointers.

Art


# begin Gemfile
source :rubygems

gem 'mysql', '2.8.1'

gem 'rails', '2.3.11'

gem 'rspec', '1.3.1'
gem 'rspec-rails', '1.3.3'
gem 'test-unit', '1.2.3'

# end Gemfile

art-imac-3:Helper-Test-Fail-Project art$ script/spec --backtrace
spec/helpers/application_helper_spec.rb
F

1)
NoMethodError in 'ApplicationHelper#app_echo should echo'
undefined method `request=' for nil:NilClass
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/activesupport-2.3.11/lib/active_support/whiny_nil.rb:52:in
`method_missing'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-rails-1.3.3/lib/spec/rails/example/helper_example_group.rb:113:in
`block in <class:HelperExampleGroup>'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_methods.rb:74:in
`instance_eval'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_methods.rb:74:in
`block in eval_each_fail_fast'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_methods.rb:74:in
`each'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_methods.rb:74:in
`eval_each_fail_fast'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_group_hierarchy.rb:17:in
`run_before_each'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_methods.rb:107:in
`run_before_each'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_methods.rb:128:in
`before_each_example'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_methods.rb:39:in
`block in execute'
/Users/art/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:44:in
`timeout'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_methods.rb:37:in
`execute'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_group_methods.rb:219:in
`block in run_examples'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_group_methods.rb:217:in
`each'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_group_methods.rb:217:in
`run_examples'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/example/example_group_methods.rb:103:in
`run'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/runner/example_group_runner.rb:23:in
`block in run'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/runner/example_group_runner.rb:22:in
`each'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/runner/example_group_runner.rb:22:in
`run'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/runner/options.rb:153:in
`run_examples'
/Users/art/.rvm/gems/ruby-1.9.2-p180 at loyal3/gems/rspec-1.3.1/lib/spec/runner/command_line.rb:9:in
`run'
script/spec:5:in `<main>'

Finished in 0.02259 seconds

1 example, 1 failure
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110323/1f0aa50a/attachment.html>


More information about the rspec-users mailing list