thoughtbot--shoulda-matchers/spec/support/unit/helpers/active_model_versions.rb

14 lines
358 B
Ruby
Raw Normal View History

2012-03-09 15:53:23 +00:00
RSpec.configure do |c|
def active_model_3_1?
(::ActiveModel::VERSION::MAJOR == 3 && ::ActiveModel::VERSION::MINOR >= 1) || active_model_4_0?
2012-03-09 15:53:23 +00:00
end
def active_model_3_2?
(::ActiveModel::VERSION::MAJOR == 3 && ::ActiveModel::VERSION::MINOR >= 2) || active_model_4_0?
end
def active_model_4_0?
::ActiveModel::VERSION::MAJOR == 4
2012-03-09 15:53:23 +00:00
end
end