Skip to content
Browse files

tell travis to use each gemfile separately

  • Loading branch information...
1 parent 8015ad5 commit bc2e17f2da70a4187968c323586755ff7baa1116 @mjankowski mjankowski committed Apr 4, 2012
Showing with 22 additions and 16 deletions.
  1. +8 −0 .travis.yml
  2. +4 −10 Appraisals
  3. +10 −6 Rakefile
View
8 .travis.yml
@@ -0,0 +1,8 @@
+language: ruby
+rvm:
+ - 1.9.2
+ - 1.9.3
+gemfile:
+ - gemfiles/rails-3.0.12.gemfile
+ - gemfiles/rails-3.1.4.gemfile
+ - gemfiles/rails-3.2.3.gemfile
View
14 Appraisals
@@ -1,11 +1,5 @@
-appraise "rails-3.2.3" do
- gem "rails", "3.2.3"
-end
-
-appraise "rails-3.1.4" do
- gem "rails", "3.1.4"
-end
-
-appraise "rails-3.0.12" do
- gem "rails", "3.0.12"
+['3.2.3', '3.1.4', '3.0.12'].each do |rails_version|
+ appraise "rails-#{rails_version}" do
+ gem "rails", rails_version
+ end
end
View
16 Rakefile
@@ -1,14 +1,18 @@
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'appraisal'
-require 'rspec/core/rake_task'
+require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
-desc "Default: run the unit tests."
-task :default => [:all]
+task :default do |t|
+ if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
+ exec 'rake spec'
+ else
+ Rake::Task['appraise'].execute
+ end
+end
-desc 'Test the plugin under all supported Rails versions.'
-task :all => ["appraisal:install"] do |t|
- exec('rake appraisal spec')
+task :appraise => ['appraisal:install'] do |t|
+ exec 'rake appraisal'
end

0 comments on commit bc2e17f

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