forked from mynyml/watchr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
34 lines (29 loc) · 949 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
def gem_opt
defined?(Gem) ? "-rubygems" : ""
end
def ruby
require 'rbconfig'
File.join([RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']]) << RbConfig::CONFIG['EXEEXT']
end
# --------------------------------------------------
# Tests
# --------------------------------------------------
task(:default => "test:all")
namespace(:test) do
desc "Run all tests"
task(:all) do
tests = Dir['test/**/test_*.rb'] - ['test/test_helper.rb']
exit system(%Q{#{ruby} #{gem_opt} -I.:lib -e"%w( #{tests.join(' ')} ).each {|file| require file }"})
end
desc "Run all tests on multiple ruby versions (requires rvm)"
task(:portability) do
%w( 1.8.6 1.8.7 1.9.1 1.9.2 1.9.3 ).each do |version|
system <<-BASH
bash -c 'source ~/.rvm/scripts/rvm;
rvm #{version};
echo "--------- v#{version} ----------\n";
rake -s test:all'
BASH
end
end
end