Skip to content

Commit

Permalink
Use appraisal for testing across ActiveRecord versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jferris committed Nov 11, 2010
1 parent 1b28476 commit 6b0b3ce
Show file tree
Hide file tree
Showing 13 changed files with 244 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .bundle/config
@@ -0,0 +1,2 @@
---
BUNDLE_DISABLE_SHARED_GEMS: "1"
12 changes: 12 additions & 0 deletions Appraisals
@@ -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 changes: 10 additions & 0 deletions Gemfile
@@ -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 changes: 51 additions & 0 deletions Gemfile.lock
@@ -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
11 changes: 5 additions & 6 deletions Rakefile
@@ -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
Expand Down Expand Up @@ -67,3 +65,4 @@ Rake::GemPackageTask.new($specification) do |package|
package.need_zip = true
package.need_tar = true
end

9 changes: 0 additions & 9 deletions features/support/env.rb
Expand Up @@ -2,14 +2,5 @@

$: << 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 changes: 11 additions & 0 deletions gemfiles/2.1.gemfile
@@ -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 changes: 40 additions & 0 deletions gemfiles/2.1.gemfile.lock
@@ -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 changes: 11 additions & 0 deletions gemfiles/2.3.gemfile
@@ -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 changes: 40 additions & 0 deletions gemfiles/2.3.gemfile.lock
@@ -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 changes: 11 additions & 0 deletions gemfiles/3.0.gemfile
@@ -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 changes: 51 additions & 0 deletions gemfiles/3.0.gemfile.lock
@@ -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
9 changes: 0 additions & 9 deletions spec/acceptance/acceptance_helper.rb
@@ -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'

Expand Down

0 comments on commit 6b0b3ce

Please sign in to comment.