Sha256: 5a0281967736561d32328f78526456133e931a813ce8979028f30abd88b7f70c

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

namespace :test do
  desc "Run doctests"
  task :doctest do
    sh "ruby #{File.dirname(__FILE__)}/../bin/rubydoctest #{File.dirname(__FILE__)}/../lib/*.rb"
    sh "ruby #{File.dirname(__FILE__)}/../bin/rubydoctest #{File.dirname(__FILE__)}/../doc/*.doctest"
  end
  
  namespace :doctest do
    desc "Run rstakeout on test/doctest files"
    task :auto do
      tests = "#{File.dirname(__FILE__)}/../test/doctest/*"
      tests_path = File.dirname(tests)
      files = "#{File.dirname(__FILE__)}/../lib/*.rb #{File.dirname(__FILE__)}/../bin/*"
      sh "#{File.dirname(__FILE__)}/../script/rstakeout 'rake test:doctest:changed DOCTESTS=#{tests_path}' #{tests} #{files} --pass-as-env"
    end
    
    desc "Run doctest(s) based on a specific file that changed"
    task :changed do
      file = ENV['CHANGED']
      doctests = ENV['DOCTESTS']
      unless file && doctests
        puts "Requires ENV['CHANGED']=file_path and ENV['DOCTESTS']=some/path/**/*.doctest"
        exit
      end
      tests = File.basename(file) =~ %r{\..*doctest\Z} ? file : doctests
      sh "ruby #{File.dirname(__FILE__)}/../bin/rubydoctest #{tests}"
    end
  end
end

Version data entries

6 entries across 6 versions & 5 rubygems

Version Path
canadaduane-rubydoctest-1.0.2 tasks/doctests.rake
matthewrudy-rubydoctest-1.0.1 tasks/doctests.rake
matthewrudy-rubydoctest-1.0.2 tasks/doctests.rake
tablatom-rubydoctest-1.0.0 tasks/doctests.rake
rdp-rubydoctest-1.0.1 tasks/doctests.rake
rubydoctest-1.0.0 tasks/doctests.rake