mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
38 lines
621 B
Ruby
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
|