[rspec-users] Modules will no longer be automatically included in RSpec version 1.1.4

David Chelimsky dchelimsky at gmail.com
Fri May 23 18:48:56 EDT 2008


On May 23, 2008, at 4:35 PM, Lori M Olson wrote:

> Can anyone (David?) shed some light on what exactly this warning is  
> complaining about?  I started seeing it when I upgraded to Rails 2.1  
> RC1 and the latest RSpec from git.
>
> I'm getting it in some helper specs that I'm writing.  And yes, I am  
> including a module there, to reuse some utility methods I originally  
> wrote for my controller tests (I'm switching to specs as fast as I  
> can, but I don't have time to re-jigger all my tests over to specs  
> yet).

Helper example groups (in git) now have a helper object that you can  
(and should) use. So instead of this:

describe SomeHelper do
   it "should be helpful" do
     some_helpful_method.should == "this result"
   end
end

You do this:

describe SomeHelper do
   it "should be helpful" do
     helper.some_helpful_method.should == "this result"
   end
end

That will make the warning go away.

The reason we did this is that somebody had a describe method in a  
helper and it created a conflict :) We realized then that including  
the module implicitly was asking for trouble.

HTH,
David


More information about the rspec-users mailing list