2014-12-31 13:41:17 -05:00
|
|
|
module MongoidVersions
|
|
|
|
def mongoid_version
|
|
|
|
Gem::Version.new(Mongoid::VERSION)
|
|
|
|
end
|
|
|
|
|
2019-01-08 15:27:44 -05:00
|
|
|
def mongoid_5_0?
|
|
|
|
Gem::Requirement.new('~> 5.0.0').satisfied_by?(mongoid_version)
|
2014-12-31 13:41:17 -05:00
|
|
|
end
|
|
|
|
|
2019-01-08 15:27:44 -05:00
|
|
|
def mongoid_6_0?
|
|
|
|
Gem::Requirement.new('~> 6.0.0').satisfied_by?(mongoid_version)
|
2014-12-31 13:41:17 -05:00
|
|
|
end
|
2021-01-15 01:04:46 -05:00
|
|
|
|
|
|
|
def mongoid_7_0?
|
|
|
|
Gem::Requirement.new('~> 7.0.0').satisfied_by?(mongoid_version)
|
|
|
|
end
|
|
|
|
|
|
|
|
def mongoid_7_1?
|
|
|
|
Gem::Requirement.new('~> 7.1.0').satisfied_by?(mongoid_version)
|
|
|
|
end
|
2014-12-31 13:41:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
RSpec.configure do |config|
|
|
|
|
config.include(MongoidVersions)
|
|
|
|
config.extend(MongoidVersions)
|
|
|
|
end
|