[rspec-devel] [ rspec-Bugs-6707 ] cannot run controller / helper tests via rails_spec or spec only works with rake

noreply at rubyforge.org noreply at rubyforge.org
Thu Nov 16 23:15:41 EST 2006


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

Category: rails plugin
Group: None
>Status: Closed
Resolution: None
Priority: 3
Submitted By: Nobody (None)
>Assigned to: David Chelimsky (dchelimsky)
Summary: cannot run controller / helper tests via rails_spec or spec only works with rake

Initial Comment:
I've tried four methods for running rails specs and here are the results for 0.7.2 (plugin and gem) on windows

ruby spec/controllers/admin/some_controller_spec.rb - WORKS but not sure if supposed to do things this way?

spec spec/controllers/admin/some_controller_spec.rb - ERROR undefined method `controller_name' for <Spec::Runner::ContextEvalModule:0x3630680> (NoMethodError)

Start rails_spec_server then
ruby script\rails_spec spec/controllers/admin/some_controller_spec.rb - ERROR undefined method `controller_name' for <Spec::Runner::ContextEvalModule:0x3630680> (NoMethodError) (SAME AS BEFORE)

rake spec - WORKS FINE

---
the sample test
---
require File.dirname(__FILE__) + '/../../spec_helper'

context "The Admin::TalentPoolsController" do
  # fixtures :talent_pools
  controller_name "admin/talent_pools"

  specify "should be a Admin::TalentPoolsController" do
    controller.should_be_an_instance_of Admin::TalentPoolsController
  end


  specify "should have more specifications" do
    violated "not enough specs"
  end
end
---
It seems that the module that contains the class method for controller_name does not get loaded except with rake / ruby?

we really need the test suite not to reload each time (current rake takes 25 minutes or longer!)
---
the same error happens with helpers and the call to helper_name


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

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

Message:
Fixed in trunk (rev 1120).

The problem was a path Regexp that failed to account for windows slashes.

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

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


More information about the rspec-devel mailing list