diff --git a/Rakefile b/Rakefile index 0974625..3fb252e 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/features/support/env.rb b/features/support/env.rb index 44f1da6..787df8f 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -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' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2039067..dbfaccb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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'