Sha256: 349dda053b4dcf9b57846fcbd65d3142861eaef03a85b77b981b3f42b292131b

Contents?: true

Size: 915 Bytes

Versions: 27

Compression:

Stored size: 915 Bytes

Contents

if test(?e, PROJ.test.file) or not PROJ.test.files.to_a.empty?
require 'rake/testtask'

namespace :test do

  Rake::TestTask.new(:run) do |t|
    t.libs = PROJ.libs
    t.test_files = if test(?f, PROJ.test.file) then [PROJ.test.file]
                   else PROJ.test.files end
    t.ruby_opts += PROJ.ruby_opts
    t.ruby_opts += PROJ.test.opts
  end

  if HAVE_RCOV
    desc 'Run rcov on the unit tests'
    task :rcov => :clobber_rcov do
      opts = PROJ.rcov.opts.dup << '-o' << PROJ.rcov.dir
      opts = opts.join(' ')
      files = if test(?f, PROJ.test.file) then [PROJ.test.file]
              else PROJ.test.files end
      files = files.join(' ')
      sh "#{RCOV} #{files} #{opts}"
    end

    task :clobber_rcov do
      rm_r 'coverage' rescue nil
    end
  end

end  # namespace :test

desc 'Alias to test:run'
task :test => 'test:run'

task :clobber => 'test:clobber_rcov' if HAVE_RCOV

end

# EOF

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
mongo3-0.1.5 tasks/test.rake
mongo3-0.1.4 tasks/test.rake
mongo3-0.1.3 tasks/test.rake
mongo3-0.1.2 tasks/test.rake
mongo3-0.1.1 tasks/test.rake
mongo3-0.1.0 tasks/test.rake
rackamole-0.2.5 tasks/test.rake
rackamole-0.2.4 tasks/test.rake
rackamole-0.2.3 tasks/test.rake
rackamole-0.2.2 tasks/test.rake
mongo3-0.0.9 tasks/test.rake
mongo3-0.0.8 tasks/test.rake
mongo3-0.0.7 tasks/test.rake
mongo3-0.0.6 tasks/test.rake
mongo3-0.0.5 tasks/test.rake
mongo3-0.0.4 tasks/test.rake
mongo3-0.0.3 tasks/test.rake
mongo3-0.0.2 tasks/test.rake
mongo3-0.0.1 tasks/test.rake
rackamole-0.2.1 tasks/test.rake