2015-01-15 12:28:02 -05:00
|
|
|
require 'rake/testtask'
|
2016-01-30 15:41:14 -05:00
|
|
|
require 'pathname'
|
|
|
|
require 'action_cable'
|
2016-05-23 09:37:16 -04:00
|
|
|
require 'blade'
|
2015-01-15 12:28:02 -05:00
|
|
|
|
2015-12-14 10:38:37 -05:00
|
|
|
dir = File.dirname(__FILE__)
|
|
|
|
|
2015-01-15 12:28:02 -05:00
|
|
|
task :default => :test
|
|
|
|
|
2016-01-31 13:01:03 -05:00
|
|
|
task :package => "assets:compile"
|
|
|
|
|
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|
|
|
|
|
sh(Gem.ruby, '-w', '-Ilib:test', file)
|
|
|
|
end or raise "Failures"
|
|
|
|
end
|
2016-05-09 09:36:53 -04:00
|
|
|
|
2016-05-09 15:42:28 -04:00
|
|
|
task :integration do
|
|
|
|
if ENV['CI']
|
|
|
|
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
|