[rspec-users] rSpec on Rails 1.2?

Courtenay court3nay at gmail.com
Sat Nov 25 00:48:33 EST 2006


No, seriously.  I mis-pasted, move the cattr_accessor up a line to
before the setter line

      cattr_accessor :fixture_path
      self.fixture_path = RAILS_ROOT + '/spec/fixtures'

I just tested again, it works a charm here.  If the cattr_accessor
line is below the fixture path it fails.

However, the fact that the test::unit stuff like transactions isn't
propagating is an indication of a deeper problem, wherein the
inherited accessors are failing.

On 11/24/06, s.ross <cwdinfo at gmail.com> wrote:
> No, that doesn't fix it. fixture_path is still nil in load_fixtures.
> Note also that use_transactional_fixtures is false when it shouldn't
> be. The settings aren't getting pushed down into AR.
>
> s.ross
>
> On Nov 24, 2006, at 8:02 PM, Courtenay wrote:
>
> > Add this line to spec_helper.rb so your testcase subclasses inherit
> > the parent's fixture path and it restores the 'old' way of rails'
> > fixtures.
> >
> > module Spec
> >   module Rails
> >     class EvalContext < Test::Unit::TestCase
> >       self.use_transactional_fixtures = true
> >       self.use_instantiated_fixtures  = false
> >       self.fixture_path = RAILS_ROOT + '/spec/fixtures'
> > +    cattr_accessor :fixture_path
> >       ...
> >     end
> >   end
> > end
> >
> >> I found the cause, it looks like this revision of edge rails
> >> introduced the error we are seeing in rspec.   http://
> >> dev.rubyonrails.org/changeset/5604
> >>
> >> -Chad
> >>
> >> On Nov 24, 2006, at 2:11 AM, s.ross wrote:
> >>
> >>> I just updated my Rails install to the most current Edge and my
> >>> controller specs fail:
> >>>
> >>> 1)
> >>> TypeError in 'The User Controller should be a user controller'
> >>> can't convert nil into String
> >>>
> >>> Each spec fails the same way.
> >>>
> >>> <context string> <spec string>
> >>> can't convert nil into String
> >>>
> >>> Any ideas what's up with this?
> >>>
> >>> Thanks,
> >>>
> >>> s.ross
> > _______________________________________________
> > 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