summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 22:32:34 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 22:32:34 +0000
commit1b023030a88a35118875b068a1fd725c58a32083 (patch)
tree07bbdc25e71d98bfa4091f617d82fc87541364c5 /test
parente9c28d0fce1fa34bd83e910273981190932ebf63 (diff)
* lib/rake*: Updated to rake 0.9.4
http://rake.rubyforge.org/doc/release_notes/rake-0_9_4_rdoc.html for a list of changes in 0.9.4. * test/rake*: ditto * NEWS: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rake/helper.rb27
-rw-r--r--test/rake/test_rake_functional.rb19
2 files changed, 45 insertions, 1 deletions
diff --git a/test/rake/helper.rb b/test/rake/helper.rb
index 5a373d3043..288ff0e3b2 100644
--- a/test/rake/helper.rb
+++ b/test/rake/helper.rb
@@ -519,4 +519,31 @@ task :default => :test
end
end
+ def rakefile_failing_test_task
+ rakefile <<-TEST_TASK
+require 'rake/testtask'
+
+task :default => :test
+Rake::TestTask.new(:test) do |t|
+ t.test_files = ['a_test.rb']
+end
+ TEST_TASK
+ open 'a_test.rb', 'w' do |io|
+ io << "require 'minitest/autorun'\n"
+ io << "class ExitTaskTest < MiniTest::Unit::TestCase\n"
+ io << " def test_exit\n"
+ io << " assert false, 'this should fail'\n"
+ io << " end\n"
+ io << "end\n"
+ end
+ end
+
+ def rakefile_stand_alone_filelist
+ open 'stand_alone_filelist.rb', 'w' do |io|
+ io << "require 'rake/file_list'\n"
+ io << "FL = Rake::FileList['*.rb']\n"
+ io << "puts FL\n"
+ end
+ end
+
end
diff --git a/test/rake/test_rake_functional.rb b/test/rake/test_rake_functional.rb
index ad59f7b9f8..2b97927e4c 100644
--- a/test/rake/test_rake_functional.rb
+++ b/test/rake/test_rake_functional.rb
@@ -439,6 +439,21 @@ class TestRakeFunctional < Rake::TestCase
end
end
+ def test_failing_test_sets_exit_status
+ rakefile_failing_test_task
+ rake
+ assert_equal 1, @exit.exitstatus
+ end
+
+ def test_stand_alone_filelist
+ rakefile_stand_alone_filelist
+
+ run_ruby @ruby_options + ["stand_alone_filelist.rb"]
+
+ assert_match(/^stand_alone_filelist\.rb$/, @out)
+ assert_equal 0, @exit.exitstatus
+ end
+
private
# Run a shell Ruby command with command line options (using the
@@ -458,14 +473,16 @@ class TestRakeFunctional < Rake::TestCase
def run_ruby(option_list)
puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
- inn, out, err = Open3.popen3(Gem.ruby, *option_list)
+ inn, out, err, wait = Open3.popen3(Gem.ruby, *option_list)
inn.close
@out = out.read
@err = err.read
+ @exit = wait.value
puts "OUTPUT: [#{@out}]" if @verbose
puts "ERROR: [#{@err}]" if @verbose
+ puts "EXIT: [#{@exit.inspect}]" if @verbose
puts "PWD: [#{Dir.pwd}]" if @verbose
end