-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathRakefile
36 lines (32 loc) · 789 Bytes
/
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
require 'rake'
require 'rake/testtask'
hw1_tasks = [
['all', 'test/hw1_*_test.rb'],
['1', 'test/hw1_part1_test.rb'],
['2', 'test/hw1_part2_test.rb'],
['3', 'test/hw1_part3_test.rb'],
['4', 'test/hw1_part4_test.rb'],
['5', 'test/hw1_part5_test.rb']
]
hw2_tasks = [
['all', 'test/hw2_*_test.rb'],
['1', 'test/hw2_part1_test.rb'],
['2', 'test/hw2_part2_test.rb']
]
def create_test_task(name, pattern)
Rake::TestTask.new(name) do |t|
t.pattern = pattern
t.verbose = true
t.warning = true
end
end
task :default => ['test:all']
create_test_task 'test:all', 'test/*_test.rb'
namespace :test do
namespace :hw1 do
hw1_tasks.each { |t| create_test_task *t }
end
namespace :hw2 do
hw2_tasks.each { |t| create_test_task *t }
end
end