Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 35 lines (29 sloc) 0.936 kB
77bd4cc @mynyml Fix rake test task for jruby/mswin. Fixes #11
authored
1 def gem_opt
2 defined?(Gem) ? "-rubygems" : ""
3 end
4
5 def ruby
6 require 'rbconfig'
7 File.join([Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']]) << Config::CONFIG['EXEEXT']
8 end
9
823a13c @mynyml Refactor gemspec and Rakefile
authored
10 # --------------------------------------------------
11 # Tests
12 # --------------------------------------------------
13 task(:default => "test:all")
6b725d5 @mynyml Add rake test:all
authored
14
15 namespace(:test) do
1b7e542 @mynyml Add portability test task
authored
16
6b725d5 @mynyml Add rake test:all
authored
17 desc "Run all tests"
18 task(:all) do
19 tests = Dir['test/**/test_*.rb'] - ['test/test_helper.rb']
77bd4cc @mynyml Fix rake test task for jruby/mswin. Fixes #11
authored
20 exit system(%Q{#{ruby} #{gem_opt} -I.:lib -e"%w( #{tests.join(' ')} ).each {|file| require file }"})
6b725d5 @mynyml Add rake test:all
authored
21 end
1b7e542 @mynyml Add portability test task
authored
22
823a13c @mynyml Refactor gemspec and Rakefile
authored
23 desc "Run all tests on multiple ruby versions (requires rvm)"
1b7e542 @mynyml Add portability test task
authored
24 task(:portability) do
5ea632d @mynyml Fix ruby1.9 compatibility
authored
25 %w( 1.8.6 1.8.7 1.9.1 1.9.2 ).each do |version|
1b7e542 @mynyml Add portability test task
authored
26 system <<-BASH
27 bash -c 'source ~/.rvm/scripts/rvm;
5ea632d @mynyml Fix ruby1.9 compatibility
authored
28 rvm #{version};
29 echo "--------- v#{version} ----------\n";
1b7e542 @mynyml Add portability test task
authored
30 rake -s test:all'
31 BASH
32 end
33 end
6b725d5 @mynyml Add rake test:all
authored
34 end
Something went wrong with that request. Please try again.