[rspec-devel] [ rspec-Bugs-6730 ] Unable to use fixtures in context

noreply at rubyforge.org noreply at rubyforge.org
Fri Nov 17 12:48:43 EST 2006


Bugs item #6730, was opened at 2006-11-17 16:37
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6730&group_id=797

Category: rails plugin
Group: None
>Status: Closed
Resolution: None
Priority: 3
Submitted By: Yossef Mendelssohn (ymendel)
>Assigned to: David Chelimsky (dchelimsky)
Summary: Unable to use fixtures in context

Initial Comment:
context "My Problem" do
  fixtures :my_problem
end

[ymendel]$ spec problem.rb
/usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/lib/spec/expectations/sugar.rb:13:in `call': undefined method `fixtures' for #<Spec::Runner::ContextEvalModule:0xb7f0aae0> (NoMethodError)
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/lib/spec/expectations/sugar.rb:13:in `_method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/lib/spec/expectations/sugar.rb:9:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/lib/spec/runner/context_eval.rb:37:in `method_missing'
        from ./problem.rb:2
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/lib/spec/runner/context.rb:14:in `initialize'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/lib/spec/runner/extensions/kernel.rb:3:in `context'
        from ./problem.rb:1
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/lib/spec/runner/command_line.rb:21:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/lib/spec/runner/command_line.rb:15:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.7.2/bin/spec:4
        from /usr/local/bin/spec:18




I've seen a similar problem in bug 6411 (http://rubyforge.org/tracker/index.php?func=detail&aid=6411&group_id=797&atid=3149).  The resolution there says it was fixed in r1088, and I'm using r1095

'gem list' returns
rspec (0.7.2, 0.7.0)
    RSpec-0.7.2 (r1095) - BDD for Ruby http://rspec.rubyforge.org/

'spec -v' returns
RSpec-0.7.2 (r1095) - BDD for Ruby
http://rspec.rubyforge.org/


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

>Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-17 17:48

Message:
The error points out that a Spec::Runner::ContextEvalModule is being invoked instead of a Spec::Rails::ModelContext, ::ControllerContext, ::HelperContext or ::ViewContext. The type of context is determined by the directory that the file is in. See http://rspec.rubyforge.org/documentation/rails/writing/index.html. If the path to the file is not in any of the paths listed on that page, the factory returns a Spec::Runner::ContextEvalModule by default.

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

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


More information about the rspec-devel mailing list