Skip to content

Commit

Permalink
Run tests in 2.1.*, 2.3.*, and 3.0.*
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed May 20, 2010
1 parent cdff38b commit c1a8d77
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
6 changes: 2 additions & 4 deletions Rakefile
Expand Up @@ -9,10 +9,8 @@ require 'cucumber/rake/task'

desc 'Default: run the specs and features.'
task :default do
%w(2.3.5 3.0.0.beta3).each do |version|
puts "Running tests with Rails #{version}"

system("CUSTOM_RAILS=#{version} rake -s spec features;")
%w(2.1 2.3 3.0).each do |version|
system("RAILS_VERSION=#{version} rake -s spec features;")
end
end

Expand Down
9 changes: 7 additions & 2 deletions features/support/env.rb
Expand Up @@ -2,8 +2,13 @@

$: << File.join(PROJECT_ROOT, 'lib')

if ENV['CUSTOM_RAILS']
gem 'activerecord', ENV['CUSTOM_RAILS']
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'
Expand Down
12 changes: 10 additions & 2 deletions spec/spec_helper.rb
Expand Up @@ -3,11 +3,19 @@

require 'rubygems'

if ENV['CUSTOM_RAILS']
gem 'activerecord', ENV['CUSTOM_RAILS']
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'

puts "Running specs using Rails #{ActiveRecord::VERSION::STRING}"

require 'spec'
require 'spec/autorun'
Expand Down

0 comments on commit c1a8d77

Please sign in to comment.