On 23-May-08, at 4:48 PM, David Chelimsky wrote:

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
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users


Thanks, David.  That makes a lot more sense.

Regards, Lori
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to