1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00
awesome_print/spec/support/mongoid_versions.rb
Bryan Hanks, PMP 7ce81f7bb9
Added mongoid 7 gemsets; ignore vendor/bundle (#395)
* Added mongoid 7 gemsets; ignore vendor/bundle

* Added specs for Mongoid 7x

* Added missing gemfiles

Co-authored-by: Bryan Hanks, PMP <bryan@master-developer.com>
2021-01-15 00:04:46 -06:00

26 lines
570 B
Ruby

module MongoidVersions
def mongoid_version
Gem::Version.new(Mongoid::VERSION)
end
def mongoid_5_0?
Gem::Requirement.new('~> 5.0.0').satisfied_by?(mongoid_version)
end
def mongoid_6_0?
Gem::Requirement.new('~> 6.0.0').satisfied_by?(mongoid_version)
end
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
end
RSpec.configure do |config|
config.include(MongoidVersions)
config.extend(MongoidVersions)
end