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

Lori M Olson loriolson at mac.com
Fri May 23 19:10:33 EDT 2008


So, for helper specs, one must now do something like:

describe SomeHelper do

   include SomeHelper

   before(:each) do
   ...
   end

   it "should do something"

end

That seems redundant, but I suppose there's a good reason for it.

Thanks for the help, Pat!

Regards, Lori

On 23-May-08, at 4:23 PM, Pat Maddox wrote:

> RSpec currently includes the described module so that you can call
> methods directly. It will no longerdo that automatically, so you'll
> have to manually include the module if you want these direct calls.
>
> Rails helpers are defined in modules, so that's why this is showing  
> up.
>
> Pat
> On 5/23/08, Pat Maddox <pergesu at gmail.com> wrote:
>> It appears when you write a spec like
>>
>> describe FooModule do ...
>>
>> Pat
>>
>>
>> On 5/23/08, Lori M Olson <loriolson at mac.com> 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).
>>>
>>> Regards, Lori
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> rspec-users mailing list
>>> rspec-users at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/rspec-users
>>>
>>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list