[rspec-users] 1.05 to 1.08
David Chelimsky
dchelimsky at gmail.com
Wed Sep 5 17:28:02 EDT 2007
On 9/5/07, Shane Mingins <smingins at elctech.com> wrote:
>
> On 5/09/2007, at 10:00 AM, David Chelimsky wrote:
>
> >> Boiled down the next routes problem in a helper spec ... using
> >> with_routing
> >>
> >> it do
> >> with_routing do |set|
> >>
> >> set.draw do |map|
> >> map.resources :articles do |article|
> >> article.resources :comments, :name_prefix => 'a_' do |
> >> comment|
> >> comment.resources :ratings, :name_prefix => 'a_c_'
> >> end
> >> end
> >> end
> >>
> >> a_c_rating_path(@article, @comment, @rating).should == "/
> >> articles/1/comments/1/ratings/1"
> >>
> >> end
> >> end
> >>
> >> This works fine in 1.05 and errors in 1.08 with the error:
> >>
> >> You have a nil object when you didn't expect it!
> >> You might have expected an instance of Array.
> >> The error occurred while evaluating nil.<<
> >
> > This looks like the same error - can you run just the file w/ this
> > spec like this:
> >
> > spec path/to/file.rb -b
> >
> > That'll produce the full backtrace.
> >
> > Thanks
> >
> >>
>
>
> Hi David
>
> I kept poking around but I cannot see why this is now not
> working .... not quite sure where the changes occurred in rspec that
> affected this but after using the with_routing method the example
> does not have access to the new routes (and still has the old ones).
>
> With the fix giving the helper spec access to the named_routes ....
> did anyone actually decide how this was broken in the first place? I
> was wondering how the helper specs had access to the named_routes
> previously?
>
> Should I add the bug on the projects tracker for this?
Please.
>
> Cheers
> Shane
>
>
>
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
More information about the rspec-users
mailing list