rubyjs / therubyrhino

Embed the Mozilla Rhino Javascript interpreter into Ruby
155 stars 40 forks source link

Problems with therubyrhino and test-unit #30

Closed tillsc closed 10 years ago

tillsc commented 10 years ago

The problem was already posted and discussed in jruby/jruby#1147. There seems to be a problem with therubyrhino together with test-unit. As far as I understood @headius suggested to post the issue here.

The problem was described by @markj9 (still reproducible in 2.0.3):

gem install 'therubyrhino'
gem install 'test-unit'
ruby -e "require 'rhino'; p Rhino::Context.new"
ruby -e "require 'rhino'; require 'test-unit'; p Rhino::Context.new"

The last command will raise an ArgumentError: wrong number of arguments calling run (1 for 0)

kares commented 10 years ago

thanks, the https://github.com/jruby/jruby/issues/1147 pretty much explains this in detail ... others might run into this issue esp. on JRuby when implementing a Java Runnable interface "dynamically". I'll try to come up with a work-around but I recommend you open this one on test-unit as well (maybe it gets a review for 3.0.0) or if possible at least support a way to not pollute the global name-space (actually that is already possible by not loading test-unit.rb: gem 'test-unit'; require 'test/unit'; require 'rhino'; p Rhino::Context.new)

kares commented 10 years ago

please use master for a while (if possible) ... if all seems fine ping me for a release in a couple of days ...