Matt Wynne
2009-May-01 13:42 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
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
David Chelimsky
2009-May-01 14:05 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
On Fri, May 1, 2009 at 8:42 AM, Matt Wynne <matt.songkick at 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]?> > 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 >
Matt Wynne
2009-May-01 16:26 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
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? cheers, Matt Wynne http://beta.songkick.com http://blog.mattwynne.net
Matt Wynne
2009-May-01 16:52 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
On 1 May 2009, at 15:05, David Chelimsky wrote:> On Fri, May 1, 2009 at 8:42 AM, Matt Wynne <matt.songkick at 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]?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?> > >> >> 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-usersMatt Wynne http://blog.mattwynne.net http://www.songkick.com
David Chelimsky
2009-May-01 17:11 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
On Fri, May 1, 2009 at 11:52 AM, Matt Wynne <matt at mattwynne.net> wrote:> > On 1 May 2009, at 15:05, David Chelimsky wrote: > >> On Fri, May 1, 2009 at 8:42 AM, Matt Wynne <matt.songkick at 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]? > > 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?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.> >> >> >>> >>> 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 > > Matt Wynne > http://blog.mattwynne.net > http://www.songkick.com > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2009-May-27 08:26 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
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?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 >
Matt Wynne
2009-May-27 12:41 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
On 27 May 2009, at 09:26, 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? > > 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.Actually you told me (some time ago) to upgrade to the latest version of RSpec, as there is some bug-fix with spec_server. I still haven''t got around to doing that, but I''ll feed back when I have. Matt Wynne http://blog.mattwynne.net http://www.songkick.com
Scott Taylor
2009-May-27 13:36 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
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 >
Matt Wynne
2009-May-27 20:59 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
On 27 May 2009, at 14:36, Scott Taylor wrote:> 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? > > Scotterm.... I create the class *in the spec* itself so not sure how I''d do that. I think I might be better off using an anonymous type instead.> > >> 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 >> > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersMatt Wynne http://blog.mattwynne.net http://www.songkick.com
Scott Taylor
2009-May-27 21:03 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
On May 27, 2009, at 4:59 PM, Matt Wynne wrote:> > On 27 May 2009, at 14:36, Scott Taylor wrote: > >> 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 > > erm.... I create the class *in the spec* itself so not sure how I''d > do that. I think I might be better off using an anonymous type > instead.Is it some sort of class only used for testing behaviour inherited from AR::Base? Scott
Matt Wynne
2009-May-27 21:24 UTC
[rspec-users] [rspec]spec_server: already initialized constant MyTestClass
On 27 May 2009, at 22:03, Scott Taylor wrote:> > On May 27, 2009, at 4:59 PM, Matt Wynne wrote: > >> >> On 27 May 2009, at 14:36, Scott Taylor wrote: >> >>> 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 >> >> erm.... I create the class *in the spec* itself so not sure how I''d >> do that. I think I might be better off using an anonymous type >> instead. > > Is it some sort of class only used for testing behaviour inherited > from AR::Base? > > ScottDoesn''t inherit from AR::Base I don''t think - why? Matt Wynne http://blog.mattwynne.net http://www.songkick.com