1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/spec/support/unit/helpers/rails_versions.rb
Elliot Winkler d59a6263ce Remove typo
2017-09-17 17:01:50 -05:00

38 lines
621 B
Ruby

module UnitTests
module RailsVersions
extend self
def self.configure_example_group(example_group)
example_group.include(self)
example_group.extend(self)
end
def rails_version
Tests::Version.new(Rails::VERSION::STRING)
end
def rails_3_x?
rails_version =~ '~> 3.0'
end
def rails_4_x?
rails_version =~ '~> 4.0'
end
def rails_lte_4?
rails_version <= 4
end
def rails_gte_4_1?
rails_version >= 4.1
end
def rails_gte_4_2?
rails_version >= 4.2
end
def rails_lte_5?
rails_version < 5
end
end
end