Sha256: 571b28a15fd1c355b70fa905616a0bd17b7e4b503531929868c010aaaafbccc5
Contents?: true
Size: 944 Bytes
Versions: 2
Compression:
Stored size: 944 Bytes
Contents
require 'rspec/core/rake_task' def run_tests(dir_glob) ENV['ARGS'] ||= '' ENV['QUIET'] ||= '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["#{dir_glob}*_spec.rb"] + Dir["#{dir_glob}test_*.rb"] test_files.each { |f| require f } res = Minitest.run(ENV['ARGS'].split) exit(res) if res != 0 end namespace :test do # test:all desc 'Run all tests' task :all do run_tests 'test/**/' end # test:... %w( base cli data_sources extra filters helpers ).each do |dir| desc "Run all #{dir} tests" task dir.to_sym do |_task| run_tests "test/#{dir}/**/" end end end RSpec::Core::RakeTask.new(:spec) do |t| t.rspec_opts = '-r ./spec/spec_helper.rb --color' t.verbose = false end desc 'Alias for test:all + rubocop' task test: [:spec, :'test:all', :rubocop]
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nanoc-4.0.0b4 | tasks/test.rake |
nanoc-4.0.0b3 | tasks/test.rake |