Issues with ZenTest's autotest and JRuby 1.1.4


#1

I am able to get ZenTest’s autotest to work with my MRI Ruby
installation but not my JRuby 1.1.4 installation.

Here is what happens when I run autotest with MRI Ruby: (I purposely
wrote a failing test)

MRI Ruby: works

[code]>ruby -S autotest
loading autotest/rspec
c:\ruby\bin\ruby -S c:\ruby\lib\ruby\gems\1.8\gems\rspec-1.1.4\bin\spec
-O spec/
spec.opts spec/item_spec.rb spec/helper.rb

Item

  • should return false for wrong price (FAILED - 1)

‘Item should should return right price’ FAILED
expected: 3,
got: 2 (using ==)
./spec/item_spec.rb:13:

Finished in 0.062 seconds
[/code]

With JRuby, it runs once and then stops with an error message.

[code]

jruby -S autotest
loading autotest/rspec
C:\jruby\jruby-1.1.4\bin\jruby.bat -S
C:\jruby\jruby-1.1.4\lib\ruby\gems\1.8\gem
s\rspec-1.1.4\bin\spec -O spec/spec.opts spec/item_spec.rb
spec/helper.rb

Item

  • should return right price (FAILED - 1)

‘Item should return right price’ FAILED
expected: 3,
got: 2 (using ==)
C:/NetBeansProjects/RubyApp
lication5/./spec/item_spec.rb:13
C:\jruby\jruby-1.1.4\lib\ruby\gems\1.8\gems\rspec-1.1.4\bin\spec:4

Finished in 0.096873 seconds

1 example, 1 failure
C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/autotest/rspec.rb:31
:in consolidate_failures': target of repeat operator is invalid: /\n(\.\/)?(.*\ .rb):[\d]+:\Z?/ (RegexpError) from C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/autotes t/rspec.rb:30:ineach’
from
C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/autotes
t/rspec.rb:30:in consolidate_failures' from C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/auto test.rb:401:inhandle_results’
from
C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/auto
test.rb:274:in run_tests' from C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/auto test.rb:228:inget_to_green’
from
C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/auto
test.rb:208:in run' from C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/auto test.rb:206:inloop’
from
C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/auto
test.rb:206:in run' from C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/auto test.rb:136:inrun’
from
C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/bin/auto
test:55
from
C:/jruby/jruby-1.1.4/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/bin/auto
test:19:in `load’
from C:/jruby/jruby-1.1.4/bin/autotest:19 [/code]


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

Here is some additional information. Here I am using autotest on a Ruby
project with unit tests

MRI Ruby

ruby -S autotest
c:\ruby\bin\ruby -I.;lib;test -rtest/unit -e “%w[test/test_item.rb].each
{ |f| r
equire f }” | unit_diff -u
Loaded suite -e
Started
F
Finished in 0.0 seconds.

  1. Failure:
    test_foo(TestItem) [./test/test_item.rb:12]:
    TODO: Write test.

1 tests, 2 assertions, 1 failures, 0 errors
Interrupt a second time to quit

JRuby

jruby -S autotest
C:\jruby\jruby-1.1.4\bin\jruby.bat -I.;lib;test -rtest/unit -e
“%w[test/test_ite
m.rb].each { |f| require f }” | unit_diff -u
<<< nothing emitted
Interrupt a second time to quit
Terminate batch job (Y/N)? Y


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email