[rspec-users] [rspec]spec_server: already initialized constant MyTestClass

Scott Taylor scott at railsnewbie.com
Wed May 27 09:36:58 EDT 2009


David Chelimsky wrote:
> On Fri, May 1, 2009 at 12:26 PM, Matt Wynne <matt at mattwynne.net> wrote:
>   
>> I'm creating a class in my spec file to test out a module, but when I run
>> the spec a second time in spec_server, I get the error above.
>>
>> I presume this is because rails is un-loading the class, and it's not
>> getting re-loaded properly as it doesn't have its own file in the
>> conventional place.
>>
>> Does anyone have a nice workaround for this?
>>     
>
>   

Have you tried manually loading the file in the spec itself?

Scott

> Judging from the silence, I think the answer is no.
>
> There is some interesting stuff going on in other threads about spork.
> Don't know if it solves this for you, but you may want to give it a
> whirl.
>
>   
>> cheers,
>> Matt Wynne
>> http://beta.songkick.com
>> http://blog.mattwynne.net
>> _______________________________________________
>> 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