Skip to content

Commit

Permalink
Merge pull request svenfuchs#33 from yabawock/appraisal
Browse files Browse the repository at this point in the history
Refactor the test suite to work with Rails 2.3 to Rails 3.2
  • Loading branch information
mjonuschat committed Dec 21, 2011
2 parents e367a69 + 8fcb350 commit 990e0be
Show file tree
Hide file tree
Showing 62 changed files with 1,254 additions and 243 deletions.
13 changes: 12 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
script: "ruby -Ilib -Itest test/all.rb"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
gemfile:
- gemfiles/rails-2.3.gemfile
- gemfiles/rails-3.0.gemfile
- gemfiles/rails-3.1.gemfile
- gemfiles/rails-3.2.gemfile
branches:
only:
- master
16 changes: 16 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
appraise 'rails-2.3' do
gem 'rack-test', '~> 0.5.7'
gem 'rails', '~> 2.3.0'
end

appraise 'rails-3.0' do
gem 'rails', '~> 3.0.0'
end

appraise 'rails-3.1' do
gem 'rails', '~> 3.1.0'
end

appraise 'rails-3.2' do
gem 'rails', '~> 3.2.0.rc1'
end
1 change: 0 additions & 1 deletion Gemfile

This file was deleted.

8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source :rubygems

gemspec

group :test do
gem 'ruby-debug', :platforms => :mri_18
gem 'ruby-debug19', :platforms => :mri_19
end
91 changes: 40 additions & 51 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,82 +1,71 @@
PATH
remote: .
specs:
routing-filter (0.2.4)
actionpack

GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (= 3.0.3)
mail (~> 2.2.9)
actionpack (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
actionpack (3.0.11)
activemodel (= 3.0.11)
activesupport (= 3.0.11)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.4)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.13)
rack-test (~> 0.5.6)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.3)
activesupport (= 3.0.3)
activemodel (3.0.11)
activesupport (= 3.0.11)
builder (~> 2.1.2)
i18n (~> 0.4)
activerecord (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activeresource (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
activesupport (3.0.3)
arel (2.0.6)
i18n (~> 0.5.0)
activesupport (3.0.11)
appraisal (0.4.0)
bundler
rake
archive-tar-minitar (0.5.2)
builder (2.1.2)
columnize (0.3.2)
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.5.0)
linecache (0.43)
mail (2.2.12)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
rack (1.2.4)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.6)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.3)
actionmailer (= 3.0.3)
actionpack (= 3.0.3)
activerecord (= 3.0.3)
activeresource (= 3.0.3)
activesupport (= 3.0.3)
bundler (~> 1.0)
railties (= 3.0.3)
railties (3.0.3)
actionpack (= 3.0.3)
activesupport (= 3.0.3)
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
rake (0.9.2.2)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
test_declarative (0.0.5)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.23)
tzinfo (0.3.31)

PLATFORMS
ruby

DEPENDENCIES
appraisal
i18n
rails (~> 3.0)
routing-filter!
ruby-debug
ruby-debug19
test_declarative
14 changes: 8 additions & 6 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,19 @@ Filters can also accept options:

## Running the tests

There are two Gemfiles in the `ci` directory in order to run the tests against different dependencies. The Rails 3 Gemfile is symlinked to the root folder, so it will be used by default.
To run the tests against different dependencies [appraisal](https://github.com/thoughtbot/appraisal) is used.

Running the tests with Rails 3.x:
Running the tests for all supported Rails versions:

$ bundle install
$ ruby -Itest -Ilib test/all.rb
$ bundle exec rake all

Running the tests with Rails 2.3.x:
Running the tests for a single version, for example Rails 3.1:

$ BUNDLE_GEMFILE=ci/Gemfile.rails-2.3.x bundle install
$ BUNDLE_GEMFILE=ci/Gemfile.rails-2.3.x ruby -Itest -Ilib test/all.rb
$ bundle install
$ bundle exec rake appraisal:rails-3.1 test

Valid appraisal targets include rails-2.3, rails-3.0, rails-3.1 and rails-3.2

## Filter order

Expand Down
10 changes: 8 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rake'
require 'bundler/setup'
require 'appraisal'
require 'rake/testtask'

Rake::TestTask.new do |t|
Expand All @@ -7,5 +8,10 @@ Rake::TestTask.new do |t|
t.verbose = false
end

task :default => :test
desc "Default: run the unit tests."
task :default => [:all]

desc 'Test the plugin under all supported Rails versions.'
task :all => ["appraisal:install"] do |t|
exec('rake appraisal test')
end
8 changes: 0 additions & 8 deletions ci/Gemfile.rails-2.3.x

This file was deleted.

40 changes: 0 additions & 40 deletions ci/Gemfile.rails-2.3.x.lock

This file was deleted.

8 changes: 0 additions & 8 deletions ci/Gemfile.rails-3.x

This file was deleted.

40 changes: 0 additions & 40 deletions ci/Gemfile.rails-3.x.lock

This file was deleted.

8 changes: 8 additions & 0 deletions gemfiles/rails-2.3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source :rubygems

gem "rack-test", "~> 0.5.7"
gem "rails", "~> 2.3.0"

gemspec :path=>"../"
46 changes: 46 additions & 0 deletions gemfiles/rails-2.3.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
PATH
remote: /Users/mjonuschat/Documents/routing-filter
specs:
routing-filter (0.2.4)
actionpack

GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.14)
actionpack (= 2.3.14)
actionpack (2.3.14)
activesupport (= 2.3.14)
rack (~> 1.1.0)
activerecord (2.3.14)
activesupport (= 2.3.14)
activeresource (2.3.14)
activesupport (= 2.3.14)
activesupport (2.3.14)
appraisal (0.4.0)
bundler
rake
i18n (0.6.0)
rack (1.1.2)
rack-test (0.5.7)
rack (>= 1.0)
rails (2.3.14)
actionmailer (= 2.3.14)
actionpack (= 2.3.14)
activerecord (= 2.3.14)
activeresource (= 2.3.14)
activesupport (= 2.3.14)
rake (>= 0.8.3)
rake (0.9.2.2)
test_declarative (0.0.5)

PLATFORMS
ruby

DEPENDENCIES
appraisal
i18n
rack-test (~> 0.5.7)
rails (~> 2.3.0)
routing-filter!
test_declarative
7 changes: 7 additions & 0 deletions gemfiles/rails-3.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source :rubygems

gem "rails", "~> 3.0.0"

gemspec :path=>"../"
Loading

0 comments on commit 990e0be

Please sign in to comment.