forked from radiumsoftware/iridium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
73 lines (60 loc) · 1.87 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "bundler/setup"
require "coffee-script"
require 'rake/testtask'
desc "Test all internal coffeescript compiles"
task :compile do
Dir['lib/iridium/**/*.coffee'].each do |path|
begin
CoffeeScript.compile File.read(path)
rescue Exception => ex
raise "#{path} could not be compiled! #{ex}"
end
end
end
namespace :test do
desc "Run all tests"
Rake::TestTask.new(:all => :compile) do |test|
test.libs << 'test'
test.pattern = 'test/**/*_test.rb'
end
desc "Runs integration tests only"
Rake::TestTask.new(:integration => :compile) do |test|
test.libs << 'test'
test.pattern = 'test/integration/**/*_test.rb'
end
desc "Run tests for thor commands"
Rake::TestTask.new(:commands => :compile) do |test|
test.libs << 'test'
test.pattern = 'test/commands/**/*_test.rb'
end
desc "Run tests for the pipeline"
Rake::TestTask.new(:pipeline) do |test|
test.libs << 'test'
test.pattern = 'test/integration/asset_pipeline_test.rb'
end
desc "Run tests for rack related thigns"
Rake::TestTask.new(:rack) do |test|
test.libs << 'test'
test.pattern = 'test/rack/**_test.rb'
end
end
namespace :phantom do
runner = File.expand_path '../lib/iridium/testing/phantomjs/run_tests.coffee', __FILE__
desc "Runs the unit test runner aganist a local qunit test file"
task :qunit => :compile do
tests = File.expand_path '../fixtures/qunit_tests.html', __FILE__
command = %Q{phantomjs #{runner} #{tests} 1000 --debug}
puts "Running: #{command}"
exec command
end
desc "Runs the unit test runner aganist a local spec file"
task :jasmine => :compile do
tests = File.expand_path '../fixtures/specs.html', __FILE__
command = %Q{phantomjs #{runner} #{tests} 1000 --debug}
puts "Running: #{command}"
exec command
end
end
task :default => 'test:all'