Sha256: e6bfe03f54269617222a56f2a8d071a1197b0ab9faf0981a11b4c5870cd86b4d

Contents?: true

Size: 1.2 KB

Versions: 15

Compression:

Stored size: 1.2 KB

Contents

# encoding: utf-8

require 'minitest/unit'

test = namespace :test do

  # test:all
  desc 'Run all tests'
  task :all do
    ENV['QUIET'] ||= 'true'
    $VERBOSE = (ENV['VERBOSE'] == 'true')

    $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/..'))

    # require our test helper so we don't have to in each individual test
    require 'test/helper'

    test_files = Dir['test/**/*_spec.rb'] + Dir['test/**/test_*.rb']
    test_files.each { |f| require f }

    exit MiniTest::Unit.new.run($VERBOSE ? %w( --verbose ) : %w())
  end

  # test:...
  %w( base cli data_sources extra filters helpers tasks ).each do |dir|
    desc "Run all #{dir} tests"
    task dir.to_sym do |task|
      ENV['QUIET'] ||= 'true'
      $VERBOSE = (ENV['VERBOSE'] == 'true')

      $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/..'))

      # require our test helper so we don't have to in each individual test
      require 'test/helper'

      test_files = Dir["test/#{dir}/**/*_spec.rb"] + Dir["test/#{dir}/**/test_*.rb"]
      test_files.each { |f| require f }

      exit MiniTest::Unit.new.run($VERBOSE ? %w( --verbose ) : %w())
    end
  end

end

desc 'Alias for test:all'
task :test => [ :'test:all' ]

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
nanoc-3.6.6 tasks/test.rake
nanoc-3.6.5 tasks/test.rake
nanoc-3.6.4 tasks/test.rake
nanoc-3.6.3 tasks/test.rake
nanoc-3.6.2 tasks/test.rake
nanoc-3.6.1 tasks/test.rake
nanoc-3.6.0 tasks/test.rake
nanoc-3.5.0 tasks/test.rake
nanoc-3.5.0b2 tasks/test.rake
nanoc-3.5.0b1 tasks/test.rake
nanoc-3.4.3 tasks/test.rake
nanoc-3.4.2 tasks/test.rake
nanoc-3.4.1 tasks/test.rake
nanoc-3.4.0 tasks/test.rake
nanoc-3.3.7 tasks/test.rake