Run tests in 2.1.*, 2.3.*, and 3.0.*

This commit is contained in:
Jon Yurek 2010-05-19 13:22:21 -04:00
parent cdff38bd08
commit c1a8d772c5
3 changed files with 19 additions and 8 deletions

View File

@ -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

View File

@ -2,8 +2,13 @@ PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
$: << 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'

View File

@ -3,11 +3,19 @@ $: << File.join(File.dirname(__FILE__))
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'