[rspec-users] rSpec on Rails 1.2?

David Chelimsky dchelimsky at gmail.com
Sat Nov 25 10:32:42 EST 2006


Well, I don't know what kind of crack I was smoking, but quite
suddenly I started experiencing the same problem. I've added the
cattr_accessor statements and all is well. This is committed to the
trunk (rev 1147).

Cheers,
David

On 11/24/06, s.ross <cwdinfo at gmail.com> wrote:
> Here's code I hacked up in my spec_helper.rb that works. Order of the
> statement is important: The cattr_accessor's must precede the
> assignments. (big sigh of relief :)
>
> module Spec
>    module Rails
>      class EvalContext < Test::Unit::TestCase
>          cattr_accessor :fixture_path
>          + cattr_accessor :use_transactional_fixtures
>          + cattr_accessor :use_instantiated_fixtures
>          self.use_transactional_fixtures = true
>          self.use_instantiated_fixtures  = false
>          self.fixture_path = RAILS_ROOT + '/spec/fixtures'
>         ...
>      end
>    end
> end
>
> 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