2016-08-06 17:28:46 +00:00
|
|
|
require "rake/testtask"
|
|
|
|
require "pathname"
|
|
|
|
require "action_cable"
|
|
|
|
require "blade"
|
2015-01-15 17:28:02 +00:00
|
|
|
|
2015-12-14 15:38:37 +00:00
|
|
|
dir = File.dirname(__FILE__)
|
|
|
|
|
2016-08-06 17:32:32 +00:00
|
|
|
task default: :test
|
2015-01-15 17:28:02 +00:00
|
|
|
|
2016-08-06 17:32:32 +00:00
|
|
|
task package: "assets:compile"
|
2016-01-31 18:01:03 +00:00
|
|
|
|
2015-12-14 15:38:37 +00:00
|
|
|
Rake::TestTask.new do |t|
|
2015-01-15 17:28:02 +00:00
|
|
|
t.libs << "test"
|
2015-12-14 15:38:37 +00:00
|
|
|
t.test_files = Dir.glob("#{dir}/test/**/*_test.rb")
|
|
|
|
t.warning = true
|
2015-01-15 17:28:02 +00:00
|
|
|
t.verbose = true
|
2015-12-14 15:38:37 +00:00
|
|
|
t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
|
2015-01-15 17:28:02 +00:00
|
|
|
end
|
2016-01-30 20:41:14 +00:00
|
|
|
|
2016-03-21 00:00:46 +00:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
|
|
|
Dir.glob("test/**/*_test.rb").all? do |file|
|
2016-08-06 17:28:46 +00:00
|
|
|
sh(Gem.ruby, "-w", "-Ilib:test", file)
|
2016-09-01 21:41:49 +00:00
|
|
|
end || raise("Failures")
|
2016-03-21 00:00:46 +00:00
|
|
|
end
|
2016-05-09 13:36:53 +00:00
|
|
|
|
2016-05-09 19:42:28 +00:00
|
|
|
task :integration do
|
2016-08-06 17:28:46 +00:00
|
|
|
if ENV["CI"]
|
2016-05-09 19:42:28 +00:00
|
|
|
Blade.start(interface: :ci)
|
|
|
|
else
|
|
|
|
Blade.start(interface: :runner)
|
|
|
|
end
|
2016-05-09 13:36:53 +00:00
|
|
|
end
|
2016-03-21 00:00:46 +00:00
|
|
|
end
|
|
|
|
|
2016-01-30 20:41:14 +00:00
|
|
|
namespace :assets do
|
2016-05-23 13:37:16 +00:00
|
|
|
desc "Compile Action Cable assets"
|
2016-01-30 20:41:14 +00:00
|
|
|
task :compile do
|
2016-05-23 13:37:16 +00:00
|
|
|
Blade.build
|
2016-01-30 20:41:14 +00:00
|
|
|
end
|
|
|
|
end
|