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/rails_versions.rb
James Cox fe0786d27c Remove mongomapper support.
it's out of date, and I don't have time to migrate and validate it.

Ideally, these 3rd party lib formatters should be added by that lib,
rather than awesome_print introspecting into the lib.
2019-01-23 15:04:12 -05:00

25 lines
605 B
Ruby

module RailsVersions
def rails_version
Gem::Version.new(::Rails::VERSION::STRING)
end
def rails_5_2?
Gem::Requirement.new('~> 5.2.0').satisfied_by?(rails_version)
end
alias_method :activerecord_5_2?, :rails_5_2?
def rails_5_1?
Gem::Requirement.new('~> 5.1.0').satisfied_by?(rails_version)
end
alias_method :activerecord_5_1?, :rails_5_1?
def rails_5_0?
Gem::Requirement.new('~> 5.0.0').satisfied_by?(rails_version)
end
alias_method :activerecord_5_0?, :rails_5_0?
end
RSpec.configure do |config|
config.include(RailsVersions)
config.extend(RailsVersions)
end