Permalink
Browse files

Two new JRuby launching tests suitable for Windows.

git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@5916 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information...
1 parent a98bbaf commit 99f6a7d92ea748f988e25e45bbe4a24390570033 @vvs vvs committed Feb 12, 2008
Showing with 12 additions and 7 deletions.
  1. +12 −7 test/test_launching_by_shell_script.rb
@@ -16,7 +16,7 @@ def jruby(*args)
def jruby_with_pipe(pipe, *args)
prev_in_process = JRuby.runtime.instance_config.run_ruby_in_process
JRuby.runtime.instance_config.run_ruby_in_process = false
- `#{pipe} | #{RUBY} #{args.join(' ')}`
+ `#{pipe} | "#{RUBY}" #{args.join(' ')}`
ensure
JRuby.runtime.instance_config.run_ruby_in_process = prev_in_process
end
@@ -31,14 +31,19 @@ def test_launch_script
assert_equal 0, $?.exitstatus
end
- if !WINDOWS
- def test_system_call_without_stdin_data_doesnt_hang
- out = jruby("-e 'system \"dir\"'")
- assert(out =~ /COPYING.LGPL/)
- end
+ def test_system_call_without_stdin_data_doesnt_hang
+ out = jruby(%q{-e "system 'dir'"})
+ assert(out =~ /COPYING.LGPL/)
+ end
+ if WINDOWS
+ def test_system_call_with_stdin_data_doesnt_hang_on_windows
+ out = jruby_with_pipe("echo echo 'one_two_three_test'", %q{-e "system 'cmd'"})
+ assert(out =~ /one_two_three_test/)
+ end
+ else
def test_system_call_with_stdin_data_doesnt_hang
- out = jruby_with_pipe("echo 'vvs'", "-e 'system \"cat\"'")
+ out = jruby_with_pipe("echo 'vvs'", %q{-e "system 'cat'"})
assert_equal("vvs\n", out)
end
end

0 comments on commit 99f6a7d

Please sign in to comment.