Commit 3b99151b by Jon Yurek

Only run metaclass specs if AS > 4.1 or Ruby < 2.1

parent de693b41
...@@ -10,6 +10,8 @@ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby ...@@ -10,6 +10,8 @@ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
gem 'rubysl', :platforms => :rbx gem 'rubysl', :platforms => :rbx
gem 'racc', :platforms => :rbx gem 'racc', :platforms => :rbx
gem 'pry'
# Hinting at development dependencies # Hinting at development dependencies
# Prevents bundler from taking a long-time to resolve # Prevents bundler from taking a long-time to resolve
group :development, :test do group :development, :test do
......
...@@ -2,6 +2,7 @@ require 'spec_helper' ...@@ -2,6 +2,7 @@ require 'spec_helper'
describe 'Metaclasses' do describe 'Metaclasses' do
context "A meta-class of dummy" do context "A meta-class of dummy" do
if active_support_version >= "4.1" || ruby_version < "2.1"
before do before do
rebuild_model("Dummy") rebuild_model("Dummy")
reset_class("Dummy") reset_class("Dummy")
...@@ -25,4 +26,5 @@ describe 'Metaclasses' do ...@@ -25,4 +26,5 @@ describe 'Metaclasses' do
assert @dummy.save assert @dummy.save
end end
end end
end
end end
...@@ -10,6 +10,8 @@ require 'ostruct' ...@@ -10,6 +10,8 @@ require 'ostruct'
ROOT = Pathname(File.expand_path(File.join(File.dirname(__FILE__), '..'))) ROOT = Pathname(File.expand_path(File.join(File.dirname(__FILE__), '..')))
puts "Testing against version #{ActiveRecord::VERSION::STRING}"
$LOAD_PATH << File.join(ROOT, 'lib') $LOAD_PATH << File.join(ROOT, 'lib')
$LOAD_PATH << File.join(ROOT, 'lib', 'paperclip') $LOAD_PATH << File.join(ROOT, 'lib', 'paperclip')
require File.join(ROOT, 'lib', 'paperclip.rb') require File.join(ROOT, 'lib', 'paperclip.rb')
...@@ -29,6 +31,7 @@ RSpec.configure do |config| ...@@ -29,6 +31,7 @@ RSpec.configure do |config|
config.include Assertions config.include Assertions
config.include ModelReconstruction config.include ModelReconstruction
config.include TestData config.include TestData
config.extend VersionHelper
config.extend RailsHelpers::ClassMethods config.extend RailsHelpers::ClassMethods
config.mock_framework = :mocha config.mock_framework = :mocha
config.before(:all) do config.before(:all) do
......
module VersionHelper
def active_support_version
ActiveSupport::VERSION::STRING
end
def ruby_version
RUBY_VERSION
end
end
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