Commit 21802b39 by Jon Yurek

Added a rake task for testing all versions. Changed gem statements to use ~>…

Added a rake task for testing all versions. Changed gem statements to use ~> instead of hard versions.
parent eefaa9ce
...@@ -8,6 +8,11 @@ require 'paperclip' ...@@ -8,6 +8,11 @@ require 'paperclip'
desc 'Default: run unit tests.' desc 'Default: run unit tests.'
task :default => [:clean, :test] task :default => [:clean, :test]
desc 'Test the paperclip plugin under all supported Rails versions.'
task :all_versions do |t|
exec('rake RAILS_VERSION=2.1 && rake RAILS_VERSION=2.3 && rake RAILS_VERSION=3.0')
end
desc 'Test the paperclip plugin.' desc 'Test the paperclip plugin.'
Rake::TestTask.new(:test) do |t| Rake::TestTask.new(:test) do |t|
t.libs << 'lib' << 'profile' t.libs << 'lib' << 'profile'
......
...@@ -7,34 +7,26 @@ require 'mocha' ...@@ -7,34 +7,26 @@ require 'mocha'
case ENV['RAILS_VERSION'] case ENV['RAILS_VERSION']
when '2.1' then when '2.1' then
puts "Using Rails 2.1.2" gem 'activerecord', '~>2.1.0'
gem 'activerecord', '2.1.2' gem 'activesupport', '~>2.1.0'
gem 'activesupport', '2.1.2' gem 'actionpack', '~>2.1.0'
gem 'actionpack', '2.1.2'
require 'activerecord'
require 'activesupport'
require 'actionpack'
when '3.0' then when '3.0' then
puts "Using Rails 3.0.0.beta3" gem 'activerecord', '~>3.0.0'
gem 'activerecord', '3.0.0.beta3' gem 'activesupport', '~>3.0.0'
gem 'activesupport', '3.0.0.beta3' gem 'actionpack', '~>3.0.0'
gem 'actionpack', '3.0.0.beta3'
require 'active_record'
require 'active_support'
require 'action_pack'
else else
puts "Using Rails 2.3.5" gem 'activerecord', '~>2.3.0'
gem 'activerecord', '2.3.5' gem 'activesupport', '~>2.3.0'
gem 'activesupport', '2.3.5' gem 'actionpack', '~>2.3.0'
gem 'actionpack', '2.3.5'
require 'active_record'
require 'active_support'
require 'action_pack'
end end
require 'active_record'
require 'active_record/version'
require 'active_support'
require 'action_pack'
puts "Testing againt version #{ActiveRecord::VERSION::STRING}"
begin begin
require 'ruby-debug' require 'ruby-debug'
rescue LoadError => e rescue LoadError => e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment