Skip to content

Commit

Permalink
Adapt test suite for multiple versions of rails
Browse files Browse the repository at this point in the history
* initialize an app inside test_helper for rails 3
* gemfiles/ contains gemfiles for 2.3, 3.0, 3.1, and 3.2
* rake bundles:test runes tests against all gemfiles
* rake bundles:install and bundles:update installs/updates
  • Loading branch information
jhawthorn committed Jul 11, 2012
1 parent 37ad67f commit 33d4c3a
Show file tree
Hide file tree
Showing 11 changed files with 416 additions and 24 deletions.
22 changes: 20 additions & 2 deletions Rakefile
Expand Up @@ -2,8 +2,26 @@ require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

desc 'Default: run unit tests.'
task :default => :test
desc 'Default: run unit tests against all versions.'
task :default => 'bundles:test'

def run_for_bundles cmd
Dir['gemfiles/*.gemfile'].each do |gemfile|
puts "\n#{gemfile}: #{cmd}"
ENV['BUNDLE_GEMFILE'] = gemfile
system(cmd)
end
end

task 'bundles:install' do
run_for_bundles 'bundle install'
end
task 'bundles:update' do
run_for_bundles 'bundle update'
end
task 'bundles:test' do
run_for_bundles 'bundle exec rake test'
end

desc 'Test the authorization plugin.'
Rake::TestTask.new(:test) do |t|
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/2.3.gemfile
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem 'rails', '~> 2.3.0'
gem 'sqlite3'
gem 'ruby_parser'
gem 'rdoc'
gemspec :path => '..'

44 changes: 44 additions & 0 deletions gemfiles/2.3.gemfile.lock
@@ -0,0 +1,44 @@
PATH
remote: /home/jhawthorn/code/declarative_authorization
specs:
declarative_authorization (0.5.5)

GEM
remote: https://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)
json (1.7.3)
rack (1.1.3)
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)
rdoc (3.12)
json (~> 1.4)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
sexp_processor (3.2.0)
sqlite3 (1.3.6)

PLATFORMS
ruby

DEPENDENCIES
declarative_authorization!
rails (~> 2.3.0)
rdoc
ruby_parser
sqlite3
8 changes: 8 additions & 0 deletions gemfiles/3.0.gemfile
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem 'rails', '~> 3.0.0'
gem 'sqlite3'
gem 'ruby_parser'
gem 'rdoc'
gemspec :path => '..'

89 changes: 89 additions & 0 deletions gemfiles/3.0.gemfile.lock
@@ -0,0 +1,89 @@
PATH
remote: /home/jhawthorn/code/declarative_authorization
specs:
declarative_authorization (0.5.5)

GEM
remote: https://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.15)
actionpack (= 3.0.15)
mail (~> 2.2.19)
actionpack (3.0.15)
activemodel (= 3.0.15)
activesupport (= 3.0.15)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
rack (~> 1.2.5)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.15)
activesupport (= 3.0.15)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.15)
activemodel (= 3.0.15)
activesupport (= 3.0.15)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
activeresource (3.0.15)
activemodel (= 3.0.15)
activesupport (= 3.0.15)
activesupport (3.0.15)
arel (2.0.10)
builder (2.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.5.0)
json (1.7.3)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
polyglot (0.3.3)
rack (1.2.5)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.15)
actionmailer (= 3.0.15)
actionpack (= 3.0.15)
activerecord (= 3.0.15)
activeresource (= 3.0.15)
activesupport (= 3.0.15)
bundler (~> 1.0)
railties (= 3.0.15)
railties (3.0.15)
actionpack (= 3.0.15)
activesupport (= 3.0.15)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.4)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
sexp_processor (3.2.0)
sqlite3 (1.3.6)
thor (0.14.6)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)

PLATFORMS
ruby

DEPENDENCIES
declarative_authorization!
rails (~> 3.0.0)
rdoc
ruby_parser
sqlite3
8 changes: 8 additions & 0 deletions gemfiles/3.1.gemfile
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem 'rails', '~> 3.1.0'
gem 'sqlite3'
gem 'ruby_parser'
gem 'rdoc'
gemspec :path => '..'

100 changes: 100 additions & 0 deletions gemfiles/3.1.gemfile.lock
@@ -0,0 +1,100 @@
PATH
remote: /home/jhawthorn/code/declarative_authorization
specs:
declarative_authorization (0.5.5)

GEM
remote: https://rubygems.org/
specs:
actionmailer (3.1.6)
actionpack (= 3.1.6)
mail (~> 2.3.3)
actionpack (3.1.6)
activemodel (= 3.1.6)
activesupport (= 3.1.6)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.6)
rack-cache (~> 1.2)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.4)
activemodel (3.1.6)
activesupport (= 3.1.6)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.6)
activemodel (= 3.1.6)
activesupport (= 3.1.6)
arel (~> 2.2.3)
tzinfo (~> 0.3.29)
activeresource (3.1.6)
activemodel (= 3.1.6)
activesupport (= 3.1.6)
activesupport (3.1.6)
multi_json (>= 1.0, < 1.3)
arel (2.2.3)
builder (3.0.0)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
json (1.7.3)
mail (2.3.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.2.0)
polyglot (0.3.3)
rack (1.3.6)
rack-cache (1.2)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.6)
actionmailer (= 3.1.6)
actionpack (= 3.1.6)
activerecord (= 3.1.6)
activeresource (= 3.1.6)
activesupport (= 3.1.6)
bundler (~> 1.0)
railties (= 3.1.6)
railties (3.1.6)
actionpack (= 3.1.6)
activesupport (= 3.1.6)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
sexp_processor (3.2.0)
sprockets (2.0.4)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)

PLATFORMS
ruby

DEPENDENCIES
declarative_authorization!
rails (~> 3.1.0)
rdoc
ruby_parser
sqlite3
8 changes: 8 additions & 0 deletions gemfiles/3.2.gemfile
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem 'rails', '~> 3.2.0'
gem 'sqlite3'
gem 'ruby_parser'
gem 'rdoc'
gemspec :path => '..'

98 changes: 98 additions & 0 deletions gemfiles/3.2.gemfile.lock
@@ -0,0 +1,98 @@
PATH
remote: /home/jhawthorn/code/declarative_authorization
specs:
declarative_authorization (0.5.5)

GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.6)
actionpack (= 3.2.6)
mail (~> 2.4.4)
actionpack (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.1.3)
activemodel (3.2.6)
activesupport (= 3.2.6)
builder (~> 3.0.0)
activerecord (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
activesupport (3.2.6)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
builder (3.0.0)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.4)
json (1.7.3)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.3.6)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.6)
actionmailer (= 3.2.6)
actionpack (= 3.2.6)
activerecord (= 3.2.6)
activeresource (= 3.2.6)
activesupport (= 3.2.6)
bundler (~> 1.0)
railties (= 3.2.6)
railties (3.2.6)
actionpack (= 3.2.6)
activesupport (= 3.2.6)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
sexp_processor (3.2.0)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
thor (0.15.4)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)

PLATFORMS
ruby

DEPENDENCIES
declarative_authorization!
rails (~> 3.2.0)
rdoc
ruby_parser
sqlite3

0 comments on commit 33d4c3a

Please sign in to comment.