From 5a4be4a91e2cb02e6bc7fb8899327d4240dde159 Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Mon, 24 Nov 2008 05:25:05 +1100 Subject: [PATCH] added ginger scenarios to run specs against all supported rails versions --- spec/ginger_scenarios.rb | 19 +++++++++++++++++++ spec/spec_helper.rb | 6 +++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 spec/ginger_scenarios.rb diff --git a/spec/ginger_scenarios.rb b/spec/ginger_scenarios.rb new file mode 100644 index 0000000..13a8346 --- /dev/null +++ b/spec/ginger_scenarios.rb @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c1afab9..8767403 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,7 +12,11 @@ vendored_rails = File.dirname(__FILE__) + '/../../../../vendor/rails' if vendored = File.exists?(vendored_rails) Dir.glob(vendored_rails + "/**/lib").each { |dir| $:.unshift dir } else - gem 'rails', "=#{ENV['VERSION']}" if ENV['VERSION'] + begin + require 'ginger' + rescue LoadError + end + gem 'rails' end RAILS_ROOT = File.dirname(__FILE__)