Forum: RSpec [rspec]spec_server: already initialized constant MyTestClass

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
67d39b1d4d6f73d49eca143e51ea254e?d=identicon&s=25 Matt Wynne (Guest)
on 2009-05-01 16:01
(Received via mailing list)
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.

Does anyone have a nice workaround for this?

cheers,
Matt Wynne
http://beta.songkick.com
http://blog.mattwynne.net
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-05-01 16:07
(Received via mailing list)
On Fri, May 1, 2009 at 8:42 AM, Matt Wynne
<matt.songkick@googlemail.com> 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.
>
> Does anyone have a nice workaround for this?

What version of rspec[-rails]?
Cdf378de2284d8acf137122e541caa28?d=identicon&s=25 Matt Wynne (mattwynne)
on 2009-05-01 19:09
(Received via mailing list)
On 1 May 2009, at 15:05, David Chelimsky wrote:

>
> What version of rspec[-rails]?

oh don't... um.

rspec 1.2.2
rails 2.2.2

we know we need to upgrade but when you have 4798 examples it's not a
task you undertake lightly!

is that likely to be the problem?

>> _______________________________________________
>> rspec-users mailing list
>> rspec-users@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-05-01 19:22
(Received via mailing list)
On Fri, May 1, 2009 at 11:52 AM, Matt Wynne <matt@mattwynne.net> wrote:
>>> getting re-loaded properly.
> we know we need to upgrade but when you have 4798 examples it's not a task
> you undertake lightly!
>
> is that likely to be the problem?

It is likely the problem as the 1.2.6 release includes a spec_server
fix. There shouldn't be any breaking changes from 1.2.2 to 1.2.6
(famous last words) so I'd give that a quick try in a branch and see
how it does.
This topic is locked and can not be replied to.