Sha256: 52118577b22ff3a1bce2e5b1d477025d823eab2ea8f3ea89a5714290c190683b

Contents?: true

Size: 1.16 KB

Versions: 6

Compression:

Stored size: 1.16 KB

Contents

namespace :test do
  desc "Run doctests"
  task :doctest do
    system("ruby #{File.dirname(__FILE__)}/../bin/rubydoctest #{File.dirname(__FILE__)}/../lib/*.rb") &&
      system("ruby #{File.dirname(__FILE__)}/../bin/rubydoctest #{File.dirname(__FILE__)}/../doc/*.doctest")
    exit($?.exitstatus)
  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 & 2 rubygems

Version Path
rubydoctest-1.1.5 tasks/doctests.rake
rubydoctest-1.1.4 tasks/doctests.rake
bryanlarsen-rubydoctest-1.0.2 tasks/doctests.rake
bryanlarsen-rubydoctest-1.1.0 tasks/doctests.rake
bryanlarsen-rubydoctest-1.1.1 tasks/doctests.rake
rubydoctest-1.1.3 tasks/doctests.rake