Closed contentfree closed 13 years ago
Also, it doesn't happen with my Ruby 1.9.2 install, just 1.8.7. (It was working fine in 1.8.7 until I switched to HEAD on master at the git repo)
Adding the following to env.rb right after require 'cucumber/rails
fixed Ruby 1.8.x for me:
if RUBY_VERSION =~ /1.8/
require 'test/unit/testresult'
Test::Unit.run = true
end
I had exactly the same problem, but for 1.9.2. Using contentfree's env.rb workaround made my asserts no longer explode.
Great fix/workaround by contentfree... thanks!
Have this issue as well. Thanks for the work-around.
I just had this same issue for Ruby 1.8.7 EE, Rails 3.0.7, and Cucumber 0.10.2 and Cucumber Rails 0.4.1. The fix above worked.
Fixed by c032b0cef534d360fe69098ae8e4eb2d6937b2e8
I upgraded from the gem version of cucumber-rails to HEAD on the git repo, updated my support files (env.rb et al) and now I'm bombing tests on ol'
assert
.My test is a typical
assert page.has_css? ...
and the resulting error isundefined method 'add_assertion' for nil:NilClass
. Stacktrace:Seems very strange... The problem, apparently, is that
TestCase#run
is never run, so whenassert
is called, the@_result
variable isn't set andadd_assertion
barfs.(Sorry about the double post -- I don't know why #96 got closed.)