Forum: JRuby Issues with ZenTest's autotest and JRuby 1.1.4

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8a0b761776621f05c6eccd9ca5ca4726?d=identicon&s=25 Chris Kutler (Guest)
on 2008-10-13 18:44
(Received via mailing list)
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)

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)

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:in `each'
       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:in `handle_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:in `get_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:in `loop'
       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:in `run'
       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
8a0b761776621f05c6eccd9ca5ca4726?d=identicon&s=25 Chris Kutler (Guest)
on 2008-10-13 19:07
(Received via mailing list)
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
This topic is locked and can not be replied to.