Skip to content
Browse files

Fix rake test task for jruby/mswin. Fixes #11

Solution by @vvs
  • Loading branch information...
1 parent 93e2919 commit 77bd4ccdb540cec96c7a93de855c6a6f6213852c @mynyml committed Feb 16, 2010
Showing with 10 additions and 1 deletion.
  1. +10 −1 Rakefile
View
11 Rakefile
@@ -1,3 +1,12 @@
+def gem_opt
+ defined?(Gem) ? "-rubygems" : ""
+end
+
+def ruby
+ require 'rbconfig'
+ File.join([Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']]) << Config::CONFIG['EXEEXT']
+end
+
# --------------------------------------------------
# Tests
# --------------------------------------------------
@@ -8,7 +17,7 @@ namespace(:test) do
desc "Run all tests"
task(:all) do
tests = Dir['test/**/test_*.rb'] - ['test/test_helper.rb']
- exit system("ruby -rubygems -I.:lib -e'%w( #{tests.join(' ')} ).each {|file| require file }'")
+ 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)"

0 comments on commit 77bd4cc

Please sign in to comment.
Something went wrong with that request. Please try again.