Greg Ditrick
2010-Jun-14 15:24 UTC
[rspec-users] I''m having a couple of nuisance things happening with jruby and rspec
Hi all, I have a couple of things that are happening when using jruby. 1) I consistently getting a ''Command <cmd> failed'' raised when using rake. The Kernel.system() call on line ~ 176 of lib/spec/rake/spectask.rb is always returning false. I''m not sure why. The specs run and work. Does anyone or has anyone have this happen? I run without rake and it works fine. It''s as if the Kernel.system() call is returning a negative false condition all the time. jruby issue? 2) jruby on Windows does not produce colors. I tried piping to wac and it parses out the color chars, but everything is still mono. If I add a puts in my spec file with color chars that will be in color but the spec run will be in mono. It is like rspec gem is doing something funky with the terminal/console output stream if it is jruby. Any ideas here? jruby 1.5 Here is my gem list: *** LOCAL GEMS *** actionmailer (2.3.8, 2.3.5) actionpack (2.3.8, 2.3.5) activerecord (2.3.8, 2.3.5) activeresource (2.3.8, 2.3.5) activesupport (2.3.8, 2.3.5) builder (2.1.2) columnize (0.3.1) faker (0.3.1) jruby-openssl (0.7) machinist (1.0.6) rack (1.1.0, 1.0.1) rails (2.3.8, 2.3.5) rake (0.8.7) rspec (1.3.0) ruby-debug (0.10.3) ruby-debug-base (0.10.3.2) sequel (3.12.1, 3.11.0) sources (0.0.1) I have to use jruby and windows for these tests. The Rails ENV is used just for convenience of loading gems. This is not a web app. I''m using rspec to unit test DB stored procedures. Thanks in advanced for nay insight to why I''m getting these, GregD
Jay McGaffigan
2010-Jun-14 15:59 UTC
[rspec-users] I''m having a couple of nuisance things happening with jruby and rspec
hmm.. for issue 1) I''ve found that rake doesn''t always give an informative message I''ve gotten better messages when I run the spec command directly: if you run rake spec you might see something like this after your tests run Command /Users/home/Projects/jruby/jruby-1.5.0/bin/jruby -I"spec:lib" "/Users/home/Projects/rcov/rspec/bin/spec" <ALL YOUR SPEC FILES HERE> if you copy and paste everything from JRuby on (e.g. /Users/home/Projects/jruby/jruby-1.5.0/bin/jruby -I"spec:lib" "/Users/home/Projects/rcov/rspec/bin/spec" <ALL YOUR SPEC FILES HERE>) and run that... you might get a better message. On Mon, Jun 14, 2010 at 11:24 AM, Greg Ditrick <gditrick at fuse.net> wrote:> Hi all, > > I have a couple of things that are happening when using jruby. > > 1) I consistently getting a ''Command <cmd> failed'' raised when using rake. ?The Kernel.system() call on line ~ 176 of lib/spec/rake/spectask.rb is always returning false. ?I''m not sure why. The specs run and work. ?Does anyone or has anyone have this happen? ?I run without rake and it works fine. ?It''s as if the Kernel.system() call is returning a negative false condition all the time. ?jruby issue? > > 2) jruby on Windows does not produce colors. ?I tried piping to wac and it parses out the color chars, but everything is still mono. ?If I add a puts in my spec file with color chars that will be in color but the spec run will be in mono. ?It is like rspec gem is doing something funky with the terminal/console output stream if it is jruby. ?Any ideas here? > > jruby 1.5 > > Here is my gem list: > > *** LOCAL GEMS *** > > actionmailer (2.3.8, 2.3.5) > actionpack (2.3.8, 2.3.5) > activerecord (2.3.8, 2.3.5) > activeresource (2.3.8, 2.3.5) > activesupport (2.3.8, 2.3.5) > builder (2.1.2) > columnize (0.3.1) > faker (0.3.1) > jruby-openssl (0.7) > machinist (1.0.6) > rack (1.1.0, 1.0.1) > rails (2.3.8, 2.3.5) > rake (0.8.7) > rspec (1.3.0) > ruby-debug (0.10.3) > ruby-debug-base (0.10.3.2) > sequel (3.12.1, 3.11.0) > sources (0.0.1) > > > I have to use jruby and windows for these tests. ?The Rails ENV is used just for convenience of loading gems. ?This is not a web app. ?I''m using rspec to unit test DB stored procedures. > > Thanks in advanced for nay insight to why I''m getting these, > > > GregD > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Greg Ditrick
2010-Jun-14 16:55 UTC
[rspec-users] I''m having a couple of nuisance things happening with jruby and rspec
Jay, Yes, I have done this and yes I don''t get any error messages. But the command ran from rake fails and rake aborts. It is like the rake task in rspec using Kernal.system is returning with a negative false here in the code: line 176 in lib/spec/rake/spectask.rb unless system(cmd) STDERR.puts failure_message if failure_message raise("Command #{cmd} failed") if fail_on_error end the cmd does not fail, but returns false. failure_message is nil obviously. Is this a jruby issue? a jruby on windows issue? Hard to figure out why it returns false when the command works. GregD ---- Jay McGaffigan <hooligan495 at gmail.com> wrote:> hmm.. > > for issue 1) > I''ve found that rake doesn''t always give an informative message > > I''ve gotten better messages when I run the spec command directly: > > if you run rake spec you might see something like this after your tests run > Command /Users/home/Projects/jruby/jruby-1.5.0/bin/jruby -I"spec:lib" > "/Users/home/Projects/rcov/rspec/bin/spec" <ALL YOUR SPEC FILES HERE> > > > if you copy and paste everything from JRuby on (e.g. > /Users/home/Projects/jruby/jruby-1.5.0/bin/jruby -I"spec:lib" > "/Users/home/Projects/rcov/rspec/bin/spec" <ALL YOUR SPEC FILES HERE>) > > and run that... you might get a better message. > > > On Mon, Jun 14, 2010 at 11:24 AM, Greg Ditrick <gditrick at fuse.net> wrote: > > Hi all, > > > > I have a couple of things that are happening when using jruby. > > > > 1) I consistently getting a ''Command <cmd> failed'' raised when using rake. ?The Kernel.system() call on line ~ 176 of lib/spec/rake/spectask.rb is always returning false. ?I''m not sure why. The specs run and work. ?Does anyone or has anyone have this happen? ?I run without rake and it works fine. ?It''s as if the Kernel.system() call is returning a negative false condition all the time. ?jruby issue? > > > > 2) jruby on Windows does not produce colors. ?I tried piping to wac and it parses out the color chars, but everything is still mono. ?If I add a puts in my spec file with color chars that will be in color but the spec run will be in mono. ?It is like rspec gem is doing something funky with the terminal/console output stream if it is jruby. ?Any ideas here? > > > > jruby 1.5 > > > > Here is my gem list: > > > > *** LOCAL GEMS *** > > > > actionmailer (2.3.8, 2.3.5) > > actionpack (2.3.8, 2.3.5) > > activerecord (2.3.8, 2.3.5) > > activeresource (2.3.8, 2.3.5) > > activesupport (2.3.8, 2.3.5) > > builder (2.1.2) > > columnize (0.3.1) > > faker (0.3.1) > > jruby-openssl (0.7) > > machinist (1.0.6) > > rack (1.1.0, 1.0.1) > > rails (2.3.8, 2.3.5) > > rake (0.8.7) > > rspec (1.3.0) > > ruby-debug (0.10.3) > > ruby-debug-base (0.10.3.2) > > sequel (3.12.1, 3.11.0) > > sources (0.0.1) > > > > > > I have to use jruby and windows for these tests. ?The Rails ENV is used just for convenience of loading gems. ?This is not a web app. ?I''m using rspec to unit test DB stored procedures. > > > > Thanks in advanced for nay insight to why I''m getting these, > > > > > > GregD > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users