summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_functional.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rake/test_rake_functional.rb')
-rw-r--r--test/rake/test_rake_functional.rb42
1 files changed, 6 insertions, 36 deletions
diff --git a/test/rake/test_rake_functional.rb b/test/rake/test_rake_functional.rb
index 23249b9..f2ce2f7 100644
--- a/test/rake/test_rake_functional.rb
+++ b/test/rake/test_rake_functional.rb
@@ -3,13 +3,11 @@ require 'fileutils'
require 'open3'
class TestRakeFunctional < Rake::TestCase
+ include RubyRunner
def setup
super
- @ruby_options = ["-I#{@rake_lib}", "-I."]
- @verbose = ENV['VERBOSE']
-
if @verbose
puts
puts
@@ -68,7 +66,7 @@ class TestRakeFunctional < Rake::TestCase
rake "--describe"
- assert_match %r{^rake a\n *A / A2 *$}m, @out
+ assert_match %r{^rake a\n *A\n *A2 *$}m, @out
assert_match %r{^rake b\n *B *$}m, @out
assert_match %r{^rake d\n *x{80}}m, @out
refute_match %r{^rake c\n}m, @out
@@ -420,8 +418,10 @@ class TestRakeFunctional < Rake::TestCase
status = $?
if @verbose
puts " SIG status = #{$?.inspect}"
- puts " SIG status.respond_to?(:signaled?) = #{$?.respond_to?(:signaled?).inspect}"
- puts " SIG status.signaled? = #{status.signaled?}" if status.respond_to?(:signaled?)
+ puts " SIG status.respond_to?(:signaled?) = " +
+ "#{$?.respond_to?(:signaled?).inspect}"
+ puts " SIG status.signaled? = #{status.signaled?}" if
+ status.respond_to?(:signaled?)
end
status.respond_to?(:signaled?) && status.signaled?
end
@@ -463,34 +463,4 @@ class TestRakeFunctional < Rake::TestCase
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)
- run_ruby(@ruby_options + option_list)
- end
-
- # Run a command line rake with the give rake options. Default
- # command line ruby options are included. Output is captured in
- # @out and @err
- def rake(*rake_options)
- run_ruby @ruby_options + [@rake_exec] + rake_options
- end
-
- # Low level ruby command runner ...
- def run_ruby(option_list)
- puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
-
- inn, out, err, wait = Open3.popen3(RUBY, *option_list)
- inn.close
-
- @exit = wait ? wait.value : $?
- @out = out.read
- @err = err.read
-
- puts "OUTPUT: [#{@out}]" if @verbose
- puts "ERROR: [#{@err}]" if @verbose
- puts "EXIT: [#{@exit.inspect}]" if @verbose
- puts "PWD: [#{Dir.pwd}]" if @verbose
- end
-
end