diff options
Diffstat (limited to 'lib/rake/testtask.rb')
-rw-r--r-- | lib/rake/testtask.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index ff4ef3b988..c693dd2626 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -64,7 +64,7 @@ module Rake # attr_accessor :loader - # Array of commandline options to pass to Ruby when running test loader. + # Array of commandline options to pass to ruby when running test loader. attr_accessor :ruby_opts # Explicitly define the list of test files to be included in a @@ -93,15 +93,18 @@ module Rake # Create the tasks defined by this task lib. def define - desc "Run tests" + (@name==:test ? "" : " for #{@name}") + desc "Run tests" + (@name == :test ? "" : " for #{@name}") task @name do FileUtilsExt.verbose(@verbose) do - args = "#{ruby_opts_string} #{run_code} #{file_list_string} #{option_list}" + args = + "#{ruby_opts_string} #{run_code} " + + "#{file_list_string} #{option_list}" ruby args do |ok, status| if !ok && status.respond_to?(:signaled?) && status.signaled? raise SignalException.new(status.termsig) elsif !ok - fail "Command failed with status (#{status.exitstatus}): [ruby #{args}]" + fail "Command failed with status (#{status.exitstatus}): " + + "[ruby #{args}]" end end end @@ -120,8 +123,8 @@ module Rake def ruby_opts_string opts = @ruby_opts.dup - opts.unshift( "-I\"#{lib_path}\"" ) unless @libs.empty? - opts.unshift( "-w" ) if @warning + opts.unshift("-I\"#{lib_path}\"") unless @libs.empty? + opts.unshift("-w") if @warning opts.join(" ") end @@ -130,12 +133,12 @@ module Rake end def file_list_string - file_list.collect { |fn| "\"#{fn}\"" }.join(' ') + file_list.map { |fn| "\"#{fn}\"" }.join(' ') end def file_list # :nodoc: if ENV['TEST'] - FileList[ ENV['TEST'] ] + FileList[ENV['TEST']] else result = [] result += @test_files.to_a if @test_files |