[rspec]spec_server: already initialized constant MyTestClass


#1

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 W.
http://beta.songkick.com
http://blog.mattwynne.net


#2

On Fri, May 1, 2009 at 8:42 AM, Matt W.
removed_email_address@domain.invalid 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]?


#3

On Fri, May 1, 2009 at 11:52 AM, Matt W. removed_email_address@domain.invalid 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.


#4

On 1 May 2009, at 15:05, David C. 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
removed_email_address@domain.invalid
http://rubyforge.org/mailman/listinfo/rspec-users


rspec-users mailing list
removed_email_address@domain.invalid
http://rubyforge.org/mailman/listinfo/rspec-users

Matt W.
http://blog.mattwynne.net
http://www.songkick.com