Closed thegengen closed 13 years ago
You need to require the testunit adapter. Try replacing
require 'wrong'
with
require 'wrong/adapters/test_unit'
I tried that too and I get the same result. Is that working on your end?
Eugen.
Whoa! It's not. Something must be wrong (sorry) with our integration tests, since we definitely have code to handle this case.
I think we might be caught in a MiniTest trap! MiniTest defines its own Test::Unit::TestCase and sometimes it gets on the LOAD_PATH since it's included in system Ruby 1.9. More research required...
$ ruby test/adapters/test_unit_test.rb
method(:teardown).source_location is ["/Users/chaffee/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/minitest/unit.rb", 772]
$ bundle exec ruby test/adapters/test_unit_test.rb
method(:teardown).source_location is ["/Users/chaffee/.rvm/gems/ruby-1.9.2-p180/gems/test-unit-2.1.2/lib/test/unit/testcase.rb", 401]
Fixed (i hope) with new release 0.5.2. Please 'gem update' and check it out.
It is working indeed but the behavior isn't ideal if the test-unit gem is missing from my system altogether. (I get a LoadError instead of the message from wrong_adapter_failure.)
I submitted a pull request for a test that fails on my machine. Once that's sorted out, I'll write a test and a patch for the behavior I'm seeing. That is, unless you want to open another ticket now and do it yourself.
Hm. I suppose I need to rescue LoadError explicitly since it's an Error not an Exception, or something like that.
On Fri, Jul 8, 2011 at 4:31 AM, minciue reply@reply.github.com wrote:
It is working indeed but the behavior isn't ideal if the test-unit gem is missing from my system altogether. (I get a LoadError instead of the message from wrong_adapter_failure.)
I submitted a pull request for a test that fails on my machine. Once that's sorted out, I'll write a test and a patch for the behavior I'm seeing. That is, unless you want to open another ticket now and do it yourself.
Reply to this email directly or view it on GitHub: https://github.com/sconover/wrong/issues/7#issuecomment-1531844
Alex Chaffee - alex@cohuman.com - http://alexch.github.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com
Hello. With test/unit and Ruby 1.8.7 (I can be more specific if that matters), wrong's assert { } calls don't show up in the assertion counts. Running the following file
Gives me this output:
I'm not too familiar with Test/Unit internals but with a pointer in the right direction I can probably write you a fix for this.
Oh, and thanks for this gem, I'm really loving it so far.