Permalink
Browse files

Add cross-ruby test tasks

  • Loading branch information...
1 parent 3337771 commit d9ad2e0bdbbbc78ee88f72fb92bde7fe5697ad8c @weppos committed Aug 19, 2010
Showing with 34 additions and 15 deletions.
  1. +34 −15 Rakefile
View
@@ -21,24 +21,9 @@ if ENV['SNAPSHOT'].to_i == 1
end
-# Run all the tests in the /test folder
-Rake::TestTask.new do |t|
- t.libs << "test"
- t.test_files = FileList["test/**/*_test.rb"]
- t.verbose = true
-end
-
-# Generate documentation
-Rake::RDocTask.new do |rd|
- rd.main = "README.rdoc"
- rd.rdoc_files.include("*.rdoc", "lib/**/*.rb")
- rd.rdoc_dir = "rdoc"
-end
-
# Run test by default.
task :default => ["test"]
-
# This builds the actual gem. For details of what all these options
# mean, and other ones you can add, check the documentation here:
#
@@ -91,6 +76,40 @@ task :gemspec do
File.open(file, "w") {|f| f << spec.to_ruby }
end
+
+# Generate documentation
+Rake::RDocTask.new do |rd|
+ rd.main = "README.rdoc"
+ rd.rdoc_files.include("*.rdoc", "lib/**/*.rb")
+ rd.rdoc_dir = "rdoc"
+end
+
+# Run all the tests in the /test folder
+Rake::TestTask.new do |t|
+ t.libs << "test"
+ t.test_files = FileList["test/**/*_test.rb"]
+ t.verbose = true
+end
+
+task "ensure_rvm" do
+ raise "RVM is not available" unless File.exist?(File.expand_path("~/.rvm/scripts/rvm"))
+end
+
+RUBIES = %w(1.8.6-p399 1.8.7-p249 1.9.1-p378 1.9.2-rc2 rbx-1.0.1-20100603 jruby-1.5.1 ree-1.8.7-2010.02)
+
+desc "Run tests for all rubies"
+task "test_rubies" => "ensure_rvm" do
+ sh "rvm #{RUBIES.join(",")} rake test"
+end
+
+RUBIES.each do |ruby|
+ desc "Run tests on Ruby #{ruby}"
+ task "test_ruby_#{ruby}"=> "ensure_rvm" do
+ sh "rvm #{ruby} rake test"
+ end
+end
+
+
desc "Remove any temporary products, including gemspec"
task :clean => [:clobber] do
rm "#{spec.name}.gemspec" if File.file?("#{spec.name}.gemspec")

0 comments on commit d9ad2e0

Please sign in to comment.