summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_functional.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-21 02:34:37 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-21 02:34:37 +0000
commit4f7a6aafa57bf57ce4b0b5e323548f0a6385d527 (patch)
tree497051dace17ac69043fa6edbb2585f6da03fe24 /test/rake/test_rake_functional.rb
parent7764dd935737aed303b3d61928ad36f4b67ae8ed (diff)
* lib/rake/*: Updated to rake 0.9.6
* doc/rake/*: ditto * test/rake/*: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake_functional.rb')
-rw-r--r--test/rake/test_rake_functional.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/rake/test_rake_functional.rb b/test/rake/test_rake_functional.rb
index d540e2ab29..23249b97fb 100644
--- a/test/rake/test_rake_functional.rb
+++ b/test/rake/test_rake_functional.rb
@@ -438,9 +438,10 @@ class TestRakeFunctional < Rake::TestCase
end
def test_failing_test_sets_exit_status
+ skip if uncertain_exit_status?
rakefile_failing_test_task
rake
- assert_equal 1, @exit.exitstatus
+ assert @exit.exitstatus > 0, "should be non-zero"
end
def test_stand_alone_filelist
@@ -449,11 +450,19 @@ class TestRakeFunctional < Rake::TestCase
run_ruby @ruby_options + ["stand_alone_filelist.rb"]
assert_match(/^stand_alone_filelist\.rb$/, @out)
- assert_equal 0, @exit.exitstatus
+ assert_equal 0, @exit.exitstatus unless uncertain_exit_status?
end
private
+ # We are unable to accurately verify that Rake returns a proper
+ # error exit status using popen3 in Ruby 1.8.7 and JRuby. This
+ # predicate function can be used to skip tests or assertions as
+ # needed.
+ def uncertain_exit_status?
+ RUBY_VERSION < "1.9" || defined?(JRUBY_VERSION)
+ end
+
# Run a shell Ruby command with command line options (using the
# default test options). Output is captured in @out and @err
def ruby(*option_list)
@@ -474,9 +483,9 @@ class TestRakeFunctional < Rake::TestCase
inn, out, err, wait = Open3.popen3(RUBY, *option_list)
inn.close
+ @exit = wait ? wait.value : $?
@out = out.read
@err = err.read
- @exit = wait.value
puts "OUTPUT: [#{@out}]" if @verbose
puts "ERROR: [#{@err}]" if @verbose