Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Rake task to test against all rubies.

  • Loading branch information...
commit 63f4e437370c1292a21ed0ed3e7d82f69e3701c2 1 parent 43ace9a
@kouno authored
Showing with 21 additions and 6 deletions.
  1. +21 −6 Rakefile
View
27 Rakefile
@@ -36,17 +36,32 @@ task :default => :spec
desc "Run Rspec tests"
RSpec::Core::RakeTask.new(:spec)
+namespace :spec do
+ namespace :rubies do
+ SUPPORTED_RUBIES = %w{ 1.8.7 1.9.2 1.9.3 jruby-1.6.7.2 rbx }
+
+ desc "Run Rspec tests on all supported rubies"
+ task :all_tasks => [:install_gems, :exec]
+
+ desc "Run `bundle install` on all rubies"
+ task :install_gems do
+ sh %{ rvm #{SUPPORTED_RUBIES.join(',')} exec bundle install }
+ end
+
+ desc "Run `bundle exec rake` on all rubies"
+ task :exec do
+ sh %{ rvm #{SUPPORTED_RUBIES.join(',')} exec bundle exec rake spec }
+ end
+ end
+end
+
desc "Run RSpec tests and produce coverage files (results viewable in coverage/index.html)"
RSpec::Core::RakeTask.new(:coverage) do |spec|
if RUBY_VERSION < '1.9'
- spec.rcov_opts = [
- '--exclude', 'spec',
- '--exclude', 'lib/activefacts/tracer.rb',
- '--exclude', 'gem/*'
- ]
+ spec.rcov_opts = %{ --exclude spec --exclude lib/activefacts/tracer.rb --exclude gem/* }
spec.rcov = true
else
- spec.rspec_opts = ['--require', 'simplecov_helper']
+ spec.rspec_opts = %w{ --require simplecov_helper }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.