added ginger scenarios to run specs against all supported rails versions

This commit is contained in:
Adam Meehan 2008-11-24 05:25:05 +11:00
parent 705e787775
commit 5a4be4a91e
2 changed files with 24 additions and 1 deletions

19
spec/ginger_scenarios.rb Normal file
View File

@ -0,0 +1,19 @@
# For use with the ginger gem to test plugin against multiple versions of Rails.
#
# To use ginger:
#
# sudo gem install freelancing-god-ginger --source=http://gems.github.com
#
# Then run
#
# ginger spec
#
Ginger.configure do |config|
rails_versions = ['2.0.2', '2.1.2', '2.2.2']
rails_versions.each do |v|
g = Ginger::Scenario.new
g['rails'] = v
config.scenarios << g.dup
end
end

View File

@ -12,7 +12,11 @@ vendored_rails = File.dirname(__FILE__) + '/../../../../vendor/rails'
if vendored = File.exists?(vendored_rails) if vendored = File.exists?(vendored_rails)
Dir.glob(vendored_rails + "/**/lib").each { |dir| $:.unshift dir } Dir.glob(vendored_rails + "/**/lib").each { |dir| $:.unshift dir }
else else
gem 'rails', "=#{ENV['VERSION']}" if ENV['VERSION'] begin
require 'ginger'
rescue LoadError
end
gem 'rails'
end end
RAILS_ROOT = File.dirname(__FILE__) RAILS_ROOT = File.dirname(__FILE__)