Running tests using JRuby

Using JRuby 1.1.1 + Rails 2.0.2 (also 1.1.2 + 2.1), I generated a Rails
app and tried running the default functional tests but getting the
error:

– cut here –
~/samples/jruby/test/temp/hello >~/testbed/jruby-1.1.1/bin/jruby -S rake
test
(in /Users/arungupta/samples/jruby/test/temp/hello)
/Users/arungupta/testbed/jruby-1.1.1/bin/jruby -Ilib:test
“/Users/arungupta/testbed/jruby-1.1.1/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb”

/Users/arungupta/testbed/jruby-1.1.1/bin/jruby -Ilib:test
“/Users/arungupta/testbed/jruby-1.1.1/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb”

/Users/arungupta/testbed/jruby-1.1.1/bin/jruby -Ilib:test
“/Users/arungupta/testbed/jruby-1.1.1/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb”
– cut here –

Tried on Mac, Windows & OpenSolaris and got exactly the same result.

What am I missing ?

Thanks,
-Arun

Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

What error? Can you include it in the paste? Thanks

I disabled DB access and was getting:

– cut here –
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
/Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:278:in
load_missing_constant': uninitialized constant ActiveRecord (NameError) from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:467:in const_missing’
from
/Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:479:in
const_missing' from /Users/arungupta/samples/jruby/test/helloworld/config/initializers/new_rails_defaults.rb:5:in /Users/arungupta/samples/jruby/test/helloworld/config/initializers/new_rails_defaults.rb’
– cut here –

So had to update “config/initializers/new_rails_defaults.rb” as:

if defined?(ActiveRecord)

Include Active Record class name as root for JSON serialized output.

ActiveRecord::Base.include_root_in_json = true

Store the full class name (including module namespace) in STI type

column.
ActiveRecord::Base.store_full_sti_class = true
end

Is that expected in Rails 2.1 ?

-Arun

Johnny P wrote:

~/samples/jruby/test/temp/hello >~/testbed/jruby-1.1.1/bin/jruby -S
-- cut here --

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I saw similar problem a few days ago.

It looks like a Rails bug - there are one or two files in the rails
project skeleton that refer to ActiveRecord. If AR is disabled, the
exception below is thrown.

Commenting out the AR lines in config/initializers/
new_rails_defaults.rb (and possibly one more file) will resolve the
issue.

cheers,
Igor

On Jun 27, 2008, at 8:53 PM, Arun G. wrote:

   from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/ 

So had to update “config/initializers/new_rails_defaults.rb” as:
Is that expected in Rails 2.1 ?

the error:
rake-0.8.1/lib/rake/rake_test_loader.rb"
Blog: http://blogs.sun.com/arungupta
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email