2017-07-17 01:11:16 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-07 01:28:46 +08:00
|
|
|
require "rake/testtask"
|
2008-05-16 13:29:55 +08:00
|
|
|
|
2016-08-07 01:37:12 +08:00
|
|
|
task default: :test
|
2008-06-28 14:29:47 +08:00
|
|
|
|
2016-02-01 02:01:03 +08:00
|
|
|
task :package
|
|
|
|
|
2009-10-17 02:56:59 +08:00
|
|
|
Rake::TestTask.new do |t|
|
2010-03-01 08:26:00 +08:00
|
|
|
t.libs << "test"
|
2019-12-17 00:55:06 +08:00
|
|
|
t.test_files = FileList["#{__dir__}/test/cases/**/*_test.rb"]
|
2009-09-06 08:10:21 +08:00
|
|
|
t.warning = true
|
2012-02-03 21:01:24 +08:00
|
|
|
t.verbose = true
|
2014-09-27 22:37:44 +08:00
|
|
|
t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
|
2008-06-28 14:29:47 +08:00
|
|
|
end
|
2009-09-01 08:09:16 +08:00
|
|
|
|
2009-11-11 08:50:15 +08:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
2017-05-15 22:17:28 +08:00
|
|
|
Dir.glob("#{__dir__}/test/**/*_test.rb").all? do |file|
|
|
|
|
sh(Gem.ruby, "-w", "-I#{__dir__}/lib", "-I#{__dir__}/test", file)
|
2016-09-02 05:41:49 +08:00
|
|
|
end || raise("Failures")
|
2009-11-11 08:50:15 +08:00
|
|
|
end
|
2009-05-13 16:10:37 +08:00
|
|
|
end
|