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