Use appraisal for testing across ActiveRecord versions

This commit is contained in:
Joe Ferris 2010-11-11 15:23:15 -06:00
parent 1b28476713
commit 6b0b3ce748
13 changed files with 244 additions and 24 deletions

2
.bundle/config Normal file
View File

@ -0,0 +1,2 @@
---
BUNDLE_DISABLE_SHARED_GEMS: "1"

12
Appraisals Normal file
View File

@ -0,0 +1,12 @@
appraise "2.1" do
gem "activerecord", "~> 2.1"
end
appraise "2.3" do
gem "activerecord", "~> 2.3"
end
appraise "3.0" do
gem "activerecord", "~> 3.0"
end

10
Gemfile Normal file
View File

@ -0,0 +1,10 @@
source "http://rubygems.org"
gem "cucumber"
gem "rake"
gem "rspec", "~> 1.3"
gem "rcov"
gem "activerecord", :require => false
gem "rr"
gem "sqlite3-ruby", :require => false
gem "appraisal"

51
Gemfile.lock Normal file
View File

@ -0,0 +1,51 @@
GEM
remote: http://rubygems.org/
specs:
activemodel (3.0.1)
activesupport (= 3.0.1)
builder (~> 2.1.2)
i18n (~> 0.4.1)
activerecord (3.0.1)
activemodel (= 3.0.1)
activesupport (= 3.0.1)
arel (~> 1.0.0)
tzinfo (~> 0.3.23)
activesupport (3.0.1)
appraisal (0.1)
bundler
rake
arel (1.0.1)
activesupport (~> 3.0.0)
builder (2.1.2)
cucumber (0.9.4)
builder (~> 2.1.2)
diff-lcs (~> 1.1.2)
gherkin (~> 2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
diff-lcs (1.1.2)
gherkin (2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
i18n (0.4.2)
json (1.4.6)
rake (0.8.7)
rcov (0.9.9)
rr (1.0.2)
rspec (1.3.0)
sqlite3-ruby (1.3.2)
term-ansicolor (1.0.5)
tzinfo (0.3.23)
PLATFORMS
ruby
DEPENDENCIES
activerecord
appraisal
cucumber
rake
rcov
rr
rspec (~> 1.3)
sqlite3-ruby

View File

@ -1,19 +1,17 @@
require 'rubygems'
require 'bundler/setup'
require 'rake'
require 'rake/rdoctask'
require 'rcov/rcovtask'
require 'date'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
require 'cucumber/rake/task'
require 'appraisal'
desc 'Default: run the specs and features.'
task :default do
system("rake -s spec:unit;")
%w(2.1 2.3 3.0).each do |version|
system("RAILS_VERSION=#{version} rake -s spec:acceptance features;")
end
task :default => 'spec:unit' do
system("rake -s appraisal spec:acceptance features;")
end
namespace :spec do
@ -67,3 +65,4 @@ Rake::GemPackageTask.new($specification) do |package|
package.need_zip = true
package.need_tar = true
end

View File

@ -2,14 +2,5 @@ PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
$: << File.join(PROJECT_ROOT, 'lib')
case ENV['RAILS_VERSION']
when '2.1' then
gem 'activerecord', '~>2.1.0'
when '3.0' then
gem 'activerecord', '~>3.0.0'
else
gem 'activerecord', '~>2.3.0'
end
require 'active_record'
require 'factory_girl'

11
gemfiles/2.1.gemfile Normal file
View File

@ -0,0 +1,11 @@
# This file was generated by Appraisal
source "http://rubygems.org"
gem "rr"
gem "activerecord", "~> 2.1"
gem "rake"
gem "sqlite3-ruby", {:require=>false}
gem "rspec", "~> 1.3"
gem "rcov"
gem "cucumber"
gem "appraisal"

40
gemfiles/2.1.gemfile.lock Normal file
View File

@ -0,0 +1,40 @@
GEM
remote: http://rubygems.org/
specs:
activerecord (2.1.0)
activesupport (= 2.1.0)
activesupport (2.1.0)
appraisal (0.1)
bundler
rake
builder (2.1.2)
cucumber (0.9.4)
builder (~> 2.1.2)
diff-lcs (~> 1.1.2)
gherkin (~> 2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
diff-lcs (1.1.2)
gherkin (2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
json (1.4.6)
rake (0.8.7)
rcov (0.9.9)
rr (1.0.2)
rspec (1.3.0)
sqlite3-ruby (1.3.2)
term-ansicolor (1.0.5)
PLATFORMS
ruby
DEPENDENCIES
activerecord (~> 2.1)
appraisal
cucumber
rake
rcov
rr
rspec (~> 1.3)
sqlite3-ruby

11
gemfiles/2.3.gemfile Normal file
View File

@ -0,0 +1,11 @@
# This file was generated by Appraisal
source "http://rubygems.org"
gem "rr"
gem "activerecord", "~> 2.3"
gem "rake"
gem "sqlite3-ruby", {:require=>false}
gem "rspec", "~> 1.3"
gem "rcov"
gem "cucumber"
gem "appraisal"

40
gemfiles/2.3.gemfile.lock Normal file
View File

@ -0,0 +1,40 @@
GEM
remote: http://rubygems.org/
specs:
activerecord (2.3.9)
activesupport (= 2.3.9)
activesupport (2.3.9)
appraisal (0.1)
bundler
rake
builder (2.1.2)
cucumber (0.9.4)
builder (~> 2.1.2)
diff-lcs (~> 1.1.2)
gherkin (~> 2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
diff-lcs (1.1.2)
gherkin (2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
json (1.4.6)
rake (0.8.7)
rcov (0.9.9)
rr (1.0.2)
rspec (1.3.0)
sqlite3-ruby (1.3.2)
term-ansicolor (1.0.5)
PLATFORMS
ruby
DEPENDENCIES
activerecord (~> 2.3)
appraisal
cucumber
rake
rcov
rr
rspec (~> 1.3)
sqlite3-ruby

11
gemfiles/3.0.gemfile Normal file
View File

@ -0,0 +1,11 @@
# This file was generated by Appraisal
source "http://rubygems.org"
gem "rr"
gem "activerecord", "~> 3.0"
gem "rake"
gem "sqlite3-ruby", {:require=>false}
gem "rspec", "~> 1.3"
gem "rcov"
gem "cucumber"
gem "appraisal"

51
gemfiles/3.0.gemfile.lock Normal file
View File

@ -0,0 +1,51 @@
GEM
remote: http://rubygems.org/
specs:
activemodel (3.0.1)
activesupport (= 3.0.1)
builder (~> 2.1.2)
i18n (~> 0.4.1)
activerecord (3.0.1)
activemodel (= 3.0.1)
activesupport (= 3.0.1)
arel (~> 1.0.0)
tzinfo (~> 0.3.23)
activesupport (3.0.1)
appraisal (0.1)
bundler
rake
arel (1.0.1)
activesupport (~> 3.0.0)
builder (2.1.2)
cucumber (0.9.4)
builder (~> 2.1.2)
diff-lcs (~> 1.1.2)
gherkin (~> 2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
diff-lcs (1.1.2)
gherkin (2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
i18n (0.4.2)
json (1.4.6)
rake (0.8.7)
rcov (0.9.9)
rr (1.0.2)
rspec (1.3.0)
sqlite3-ruby (1.3.2)
term-ansicolor (1.0.5)
tzinfo (0.3.23)
PLATFORMS
ruby
DEPENDENCIES
activerecord (~> 3.0)
appraisal
cucumber
rake
rcov
rr
rspec (~> 1.3)
sqlite3-ruby

View File

@ -1,12 +1,3 @@
case ENV['RAILS_VERSION']
when '2.1' then
gem 'activerecord', '~>2.1.0'
when '3.0' then
gem 'activerecord', '~>3.0.0'
else
gem 'activerecord', '~>2.3.0'
end
require 'active_record'
require 'active_record/version'