Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

error in DocumentationFormatter#failure_output when raise exception in before block #58

Open
masarakki opened this Issue · 4 comments

3 participants

@masarakki

some exception raised in before block,
example#description be changed to nil,
so failure_output raise "undefined method `strip' for nil:NilClass"

example:
https://gist.github.com/2299693

please toggle the line #4 to comment, and try again.

@dchelimsky
Owner

What version of rspec?

@masarakki

rspec (2.9.0)
rspec-core (2.9.0)
rspec-expectations (2.9.1)
rspec-mocks (2.9.0)
rspec-rails (2.9.0)

and ruby-1.9.3-p125

now, i create clean environment by rvm and try again, same problem occurred.
%rvm use --create 1.9.3@rspec_test
%gem install rspec
%rspec foo_spec.rb --cfs

@JoshCheek

Is this fixed? this commit looks like it might do it.

If not, I was going to relay what I found just now when I hit this issue:

  • The formatter dies when it asks the example for its description (This happens in several places, here is one)
  • The example gets its description from its metadata. (code -- note this has since changed)
  • The metadata check their superclass hash for the :description key and return that if it exists. (code)
  • In these cases, the description has been set to nil (code -- note this code has since changed)

That's as far as I went since I was able to get it to not die by ensuring that description assignment had a string, and I don't really know what it ought to be (based on the values of the other descriptions I saw while troubleshooting, it seems that it was wanting to render code into text for the descriptions like "should == ["a", 1]").

@masarakki

it works well, good! thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.