mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
f922613386
* Change 'spec' Rake task to 'spec:unit' * Require unit_spec_helper.rb in unit tests, not spec_helper.rb * Re-namespace files in spec/support/unit under UnitTests * Files in spec/support/unit/helpers no longer automatically add themselves to RSpec - this happens in unit_spec_helper.rb * Extract RecordWithDifferentErrorAttributeBuilder and RecordValidatingConfirmationBuilder to separate files
20 lines
533 B
Ruby
20 lines
533 B
Ruby
module UnitTests
|
|
module ActiveModelVersions
|
|
def self.configure_example_group(example_group)
|
|
example_group.include(self)
|
|
example_group.extend(self)
|
|
end
|
|
|
|
def active_model_3_1?
|
|
(::ActiveModel::VERSION::MAJOR == 3 && ::ActiveModel::VERSION::MINOR >= 1) || active_model_4_0?
|
|
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
|
|
end
|
|
end
|
|
end
|