[rspec-devel] [ rspec-Bugs-6411 ] Can't run Rails specs with ruby

noreply at rubyforge.org noreply at rubyforge.org
Wed Nov 1 11:55:21 EST 2006


Bugs item #6411, was opened at 2006-10-30 20:20
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6411&group_id=797

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Aslak Hellesoy (aslak_hellesoy)
Assigned to: Nobody (None)
Summary: Can't run Rails specs with ruby

Initial Comment:
Standing in vendor/rspec_on_rails:

ruby spec/models/person_spec.rb

/Users/aslakhellesoy/scm/rspec/trunk/vendor/rspec_on_rails/config/../../../lib/spec/expectations/sugar.rb:13:in `call': undefined method `fixtures' for #<Spec::Runner::ContextEvalModule:0x2769dc4> (NoMethodError)
        from /Users/aslakhellesoy/scm/rspec/trunk/vendor/rspec_on_rails/config/../../../lib/spec/expectations/sugar.rb:13:in `_method_missing'
        from /Users/aslakhellesoy/scm/rspec/trunk/vendor/rspec_on_rails/config/../../../lib/spec/expectations/sugar.rb:9:in `method_missing'
        from /Users/aslakhellesoy/scm/rspec/trunk/vendor/rspec_on_rails/config/../../../lib/spec/runner/context_eval.rb:37:in `method_missing'
        from spec/models/person_spec.rb:4
        from /Users/aslakhellesoy/scm/rspec/trunk/vendor/rspec_on_rails/config/../../../lib/spec/runner/context.rb:14:in `initialize'
        from /Users/aslakhellesoy/scm/rspec/trunk/vendor/rspec_on_rails/config/../vendor/plugins/rspec/lib/spec/rails/context_factory.rb:17:in `create'
        from /Users/aslakhellesoy/scm/rspec/trunk/vendor/rspec_on_rails/vendor/plugins/rspec/lib/extensions/kernel.rb:4:in `context'
        from spec/models/person_spec.rb:3

----------------------------------------------------------------------

Comment By: George Anderson (caton)
Date: 2006-11-01 11:55

Message:
I'm not sure this is isolated to running a spec via "ruby."

I've tried the following (in the context of a rails app) with revsions 1000, 1004, and 1006:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~/work/stc_rl_reporting $ rake spec:models
(in /Users/george/work/stc_rl_reporting)
/usr/local/bin/ruby -I"/usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib" "/usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/bin/spec" "spec/models/report_spec.rb" "spec/models/site_spec.rb"  
/usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:13:in `call': undefined local variable or method `setup_parts' for #<Spec::Runner::ContextEvalModule:0x2b53ae0> (NameError)        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:13:in `_method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:9:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_eval.rb:37:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context.rb:82:in `method_missing'
        from /Users/george/work/stc_rl_reporting/config/../vendor/plugins/rspec/lib/rspec_on_rails.rb:104:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_runner.rb:25:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_runner.rb:24:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/bin/spec:18
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -I"/usr/local/lib/ruby...]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~/work/stc_rl_reporting $ spec spec/models/report_spec.rb   
/usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:13:in `call': undefined local variable or method `setup_parts' for #<Spec::Runner::ContextEvalModule:0x2f5b060> (NameError)        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:13:in `_method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:9:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_eval.rb:37:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context.rb:82:in `method_missing'
        from /Users/george/work/stc_rl_reporting/config/../vendor/plugins/rspec/lib/rspec_on_rails.rb:104:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_runner.rb:25:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_runner.rb:24:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/bin/spec:18
        from /usr/local/bin/spec:18

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~/work/stc_rl_reporting $ ruby spec/models/report_spec.rb
/usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:13:in `call': undefined local variable or method `setup_parts' for #<Spec::Runner::ContextEvalModule:0x286b3a0> (NameError)        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:13:in `_method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/expectations/sugar.rb:9:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_eval.rb:37:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context.rb:82:in `method_missing'
        from /Users/george/work/stc_rl_reporting/config/../vendor/plugins/rspec/lib/rspec_on_rails.rb:104:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_runner.rb:25:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/context_runner.rb:24:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.0/lib/spec/runner/extensions/kernel.rb:11:in `context_runner'
        from spec/models/report_spec.rb:6

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It seems the issue persists whether you run via ruby, rake, or spec.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6411&group_id=797


More information about the rspec-devel mailing list