summaryrefslogtreecommitdiff
path: root/test/rake/helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rake/helper.rb')
-rw-r--r--test/rake/helper.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/rake/helper.rb b/test/rake/helper.rb
index 65443fc1117..5a373d3043d 100644
--- a/test/rake/helper.rb
+++ b/test/rake/helper.rb
@@ -1,4 +1,5 @@
require 'rubygems'
+$:.unshift File.expand_path('../../lib', __FILE__)
begin
gem 'minitest'
@@ -488,5 +489,34 @@ end
VERBOSE
end
+ def rakefile_test_signal
+ rakefile <<-TEST_SIGNAL
+require 'rake/testtask'
+
+Rake::TestTask.new(:a) do |t|
+ t.test_files = ['a_test.rb']
+end
+
+Rake::TestTask.new(:b) do |t|
+ t.test_files = ['b_test.rb']
+end
+
+task :test do
+ Rake::Task[:a].invoke rescue nil
+ Rake::Task[:b].invoke rescue nil
end
+task :default => :test
+ TEST_SIGNAL
+ open 'a_test.rb', 'w' do |io|
+ io << 'puts "ATEST"' << "\n"
+ io << '$stdout.flush' << "\n"
+ io << 'Process.kill("TERM", $$)' << "\n"
+ end
+ open 'b_test.rb', 'w' do |io|
+ io << 'puts "BTEST"' << "\n"
+ io << '$stdout.flush' << "\n"
+ end
+ end
+
+end