Permalink
Browse files

Add Appraisal to test against multiple Rails

  • Loading branch information...
1 parent 221d9f5 commit 57953fc6cefc5cc32cc4596cd167ae5f196c894d @sikachu committed Aug 6, 2013
Showing with 62 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +16 −1 .travis.yml
  3. +11 −0 Appraisals
  4. +2 −0 README.md
  5. +7 −0 Rakefile
  6. +7 −0 gemfiles/rails_3_1.gemfile
  7. +7 −0 gemfiles/rails_3_2.gemfile
  8. +7 −0 gemfiles/rails_4_0.gemfile
  9. +1 −0 sprockets-redirect.gemspec
  10. +3 −1 test/redirect_test.rb
View
@@ -6,3 +6,4 @@ pkg
*.gem
*.rbc
Gemfile.lock
+gemfiles/*.lock
View
@@ -1,9 +1,24 @@
rvm:
- 1.8.7
- 1.9.3
+ - 2.0.0
- ree
- rbx-18mode
- rbx-19mode
- jruby
-script: "bundle exec rake"
+gemfile:
+ - gemfiles/rails_3_1.gemfile
+ - gemfiles/rails_3_2.gemfile
+ - gemfiles/rails_4_0.gemfile
+
+script: "bundle exec rake test"
+
+matrix:
+ exclude:
+ - rvm: 1.8.7
+ gemfile: gemfiles/rails_4_0.gemfile
+ - rvm: ree
+ gemfile: gemfiles/rails_4_0.gemfile
+ - rvm: rbx-18mode
+ gemfile: gemfiles/rails_4_0.gemfile
View
@@ -0,0 +1,11 @@
+appraise 'rails-3-1' do
+ gem 'rails', '~> 3.1.0'
+end
+
+appraise 'rails-3-2' do
+ gem 'rails', '~> 3.2.0'
+end
+
+appraise 'rails-4-0' do
+ gem 'rails', '~> 4.0.0'
+end
View
@@ -75,6 +75,8 @@ Contributing
If you found any bug or would like to request a feature, please use Github's [issue tracker](https://github.com/sikachu/sprockets-redirect/issues) to report them. [Pull requests](https://github.com/sikachu/sprockets-redirect/pulls) are always welcomed if you also want to help me fix it. Please make sure to include a test to make sure that I don't break it in the future.
+Also, you should run `rake test_all` to run the test against multiple versions of Ruby. We're currently testing against Rails 3.1, 3.2 and 4.0
+
License
-------
View
@@ -1,8 +1,15 @@
+require 'bundler/setup'
require 'rake/testtask'
require 'rubygems/package_task'
+require 'appraisal'
task :default => :test
+task :test_all => 'appraisal:install' do
+ ENV['WITHIN_APPRAISAL'] = '1'
+ exec 'rake appraisal test'
+end
+
Rake::TestTask.new(:test) do |t|
t.test_files = Dir.glob("test/**/*_test.rb")
t.verbose = true
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "https://rubygems.org"
+
+gem "rails", "~> 3.1.0"
+
+gemspec :path=>"../"
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "https://rubygems.org"
+
+gem "rails", "~> 3.2.0"
+
+gemspec :path=>"../"
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "https://rubygems.org"
+
+gem "rails", "~> 4.0.0"
+
+gemspec :path=>"../"
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
s.add_dependency 'rack'
s.add_dependency 'activesupport', '>= 3.1.0'
+ s.add_development_dependency 'appraisal'
s.add_development_dependency 'bundler'
s.add_development_dependency 'rake'
s.add_development_dependency 'rack-test'
View
@@ -1,7 +1,9 @@
require 'sprockets/redirect'
-
require 'test/unit'
require 'rack/test'
+require 'active_support'
+
+puts ">> Testing against Rails #{ActiveSupport::VERSION::STRING}"
class TestRedirect < Test::Unit::TestCase
include Rack::Test::Methods

0 comments on commit 57953fc

Please sign in to comment.