test-unit/test-unit — Issue #19: JRuby: TypeError: can't convert nil into Float
Author: jorgenpt
Created: 2012-02-20 01:48:10+00:00
State: open

I'm using JRuby 1.6.5, test-unit 2.4.7, and JRuby in 1.9 compat mode (compat.version=1.9 in my .jrubyrc).

When I run a test-case with bundle exec ruby test/my_test.rb and it throws an exception, I get the following:

```
Finished in 2.446 seconds.

2 tests, 7 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

0.82 tests/s, 2.86 assertions/s
TypeError: can't convert nil into Float
log10 at org/jruby/RubyMath.java:450
output_code_snippet at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/console/testrunner.rb:205
output_fault_backtrace at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/console/testrunner.rb:195
each at org/jruby/RubyArray.java:1612
each_with_index at org/jruby/RubyEnumerable.java:956
output_fault_backtrace at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/console/testrunner.rb:193
output_fault_in_detail at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/console/testrunner.rb:187
output_progress_in_detail at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/console/testrunner.rb:391
add_fault at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/console/testrunner.rb:90
call at org/jruby/RubyMethod.java:133
call at org/jruby/RubyProc.java:258
notify_listeners at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/util/observable.rb:78
each at org/jruby/RubyArray.java:1612
notify_listeners at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/util/observable.rb:78
run_suite at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/testrunnermediator.rb:46
call at org/jruby/RubyProc.java:258
notify_listeners at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/util/observable.rb:78
each at org/jruby/RubyArray.java:1612
notify_listeners at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/util/observable.rb:78
notify_fault at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/testresult.rb:121
add_error at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/error.rb:124
add_error at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/error.rb:114
handle_all_exception at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/error.rb:87
__send__ at org/jruby/RubyBasicObject.java:1694
send at org/jruby/RubyKernel.java:2118
handle_exception at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/testcase.rb:568
each at org/jruby/RubyArray.java:1612
handle_exception at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/testcase.rb:567
run at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/testcase.rb:331
run at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/testsuite.rb:53
run at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/testsuite.rb:53
run_suite at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/testrunnermediator.rb:54
start_mediator at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/testrunner.rb:40
start at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/testrunner.rb:25
run at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/ui/testrunnerutilities.rb:24
run at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/autorunner.rb:369
run at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit/autorunner.rb:58
(root) at /Users/jtjerno/.rvm/gems/jruby-1.6.5@arduino_protocol/gems/test-unit-2.4.7/lib/test/unit.rb:326
org.jruby.exceptions.RaiseException: (SystemExit) exit
```