Forum: JRuby running autospec from jruby

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.
22785d4dbf585723bf60458ece0170e1?d=identicon&s=25 Joseph Athman (Guest)
on 2008-12-14 07:11
(Received via mailing list)
I can't seem to get autospec to run using JRuby.  The autospec command
doesn't seem to work like gem or rake do.  Here's what I get:
arthman:railpro jjathman$ jruby -S autospec
loading autotest/rails_rspec
/opt/local/bin/ruby -S spec/models/rail_connection_spec.rb
spec/controllers/sessions_controller_spec.rb spec/models/reset_spec.rb
........plus other stuff.


Have any JRuby users gotten this working successfully?  Thanks.

Joe
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2008-12-14 18:06
(Received via mailing list)
Joseph Athman wrote:
> Have any JRuby users gotten this working successfully?  Thanks.
Yeah, I think autospec tries to always run ruby, which is certainly a
bug in autospec. But I thought I'd seen others get it working.

- Charlie

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

    http://xircles.codehaus.org/manage_email
22785d4dbf585723bf60458ece0170e1?d=identicon&s=25 Joseph Athman (Guest)
on 2008-12-15 00:39
(Received via mailing list)
I think I found where the problem is, but I don't know how to fix it.
In
the autospec script the line:system (RUBY_PLATFORM =~ /mswin|mingw/ ?
'autotest.bat' : 'autotest'), *ARGV

will always end up invoking the first autotest command in the path.
Since
MRI is the first one in my path I think this gets invoked every time.
 Anyone have a hack/patch for this?

Joe

On Sun, Dec 14, 2008 at 11:06 AM, Charles Oliver Nutter <
503ff07a34e16373533ad78ce54e8000?d=identicon&s=25 Rich Apodaca (rapodaca)
on 2009-01-04 18:52
I'm also not able to run autospec from jruby. I'm pretty new to
autospec, but have gotten it to run successfully with MRI.

Using rails 2.2.2, rspec-1.1.11, rspec-rails-1.1.11, and JRuby 1.1.5 on
Ubuntu:

1) rails spectest; cd spectest

2) nano config/database.yml ...

3) jruby -S script/generate rspec

4) jruby script/generate rspec_controller things index

Then executing:

jruby -S autospec

gives no console output and no indication that anything is happening. I
also uninstalled MRI rspec/rspec-rails because it appeared that this
version was loading. I also removed the default JRuby rspec gem and
re-installed the gem myself (made no difference).

I can, however get my specs to run:

jruby -S spec

Any ideas?
503ff07a34e16373533ad78ce54e8000?d=identicon&s=25 Rich Apodaca (rapodaca)
on 2009-01-04 21:42
Rich Apodaca wrote:
> Any ideas?

Workaround - in script/autospec use 'jruby -S autotest':

#!/usr/bin/env ruby
ENV['RSPEC'] = 'true'     # allows autotest to discover rspec
ENV['AUTOTEST'] = 'true'  # allows autotest to run w/ color on linux
system((RUBY_PLATFORM =~ /mswin|mingw/ ? 'autotest.bat' : 'jruby -S
autotest'), *ARGV) ||
  $stderr.puts("Unable to find autotest.  Please install ZenTest or fix
your PATH")

The problem is that this runs autospec very slowly because the entire
rails environment is loaded w/ JRuby each time a change is made to my
code.

I haven't been able to get druby (which is supposed to avoid the rails
initialization overhead for repeated spec runs) to work under
jruby/rails:

http://stackoverflow.com/questions/66770/why-is-rs...

http://rspec.info/documentation/rails/runners.html

It complains:

(druby://127.0.0.1:8989) script/spec_server:14:in `run': closed stream
(IOError)
This topic is locked and can not be replied to.