2017-07-23 23:17:16 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-07 01:28:46 +08:00
|
|
|
require "rake/testtask"
|
2004-11-24 09:04:44 +08:00
|
|
|
|
|
|
|
desc "Default Task"
|
2012-10-08 01:54:14 +08:00
|
|
|
task default: [ :test ]
|
2004-11-24 09:04:44 +08:00
|
|
|
|
2016-02-01 02:01:03 +08:00
|
|
|
task :package
|
|
|
|
|
2004-11-24 09:04:44 +08:00
|
|
|
# Run the unit tests
|
|
|
|
Rake::TestTask.new { |t|
|
|
|
|
t.libs << "test"
|
2016-08-07 01:28:46 +08:00
|
|
|
t.pattern = "test/**/*_test.rb"
|
2009-11-10 13:42:17 +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)
|
2004-11-24 09:04:44 +08:00
|
|
|
}
|
|
|
|
|
2009-11-11 08:50:15 +08:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
2010-01-25 02:36:42 +08:00
|
|
|
Dir.glob("test/**/*_test.rb").all? do |file|
|
2016-08-07 01:28:46 +08:00
|
|
|
sh(Gem.ruby, "-w", "-Ilib: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
|