-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
28 lines (25 loc) · 708 Bytes
/
Copy pathRakefile
File metadata and controls
28 lines (25 loc) · 708 Bytes
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
desc "Erases the doc folder and recreates the RDoc"
task :doc do
doc_dir = File.join(File.dirname(__FILE__), "doc")
FileUtils.rm_r(doc_dir) if File.exists?(doc_dir)
`rdoc -x test`
end
desc "Runs all tests"
task :test do
test_dir = File.join(File.dirname(__FILE__), "test")
run_tests_in_directory(test_dir)
end
def run_tests_in_directory(path)
Dir.open(path) do |dir|
dir.each do |filename|
file_path = File.join(path, filename)
next if /^\.(\.)?$/ =~ filename
if /.*_test.rb$/ =~ file_path
puts "Running #{filename}"
puts `ruby #{file_path}`
elsif File.directory? file_path
run_tests_in_directory(file_path)
end
end
end
end