public Method

TestTask.define

Create the tasks defined by this task lib.

Source Code

# File rake/testtask.rb, line 97
def define
  lib_path = @libs.join(File::PATH_SEPARATOR)
  desc "Run tests" + (@name==:test ? "" : " for #{@name}")
  task @name do
    run_code = ''
    RakeFileUtils.verbose(@verbose) do
      run_code =
        case @loader
        when :direct
          "-e 'ARGV.each{|f| load f}'"
        when :testrb
          "-S testrb #{fix}"
        when :rake
          rake_loader
        end
      @ruby_opts.unshift( "-I#{lib_path}" )
      @ruby_opts.unshift( "-w" ) if @warning
      ruby @ruby_opts.join(" ") +
        " \"#{run_code}\" " +
        file_list.collect { |fn| "\"#{fn}\"" }.join(' ') +
        " #{option_list}"
    end
  end
  self
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.