2014-10-27 00:51:42 +00:00
|
|
|
module UnitTests
|
|
|
|
module RailsVersions
|
|
|
|
def self.configure_example_group(example_group)
|
|
|
|
example_group.include(self)
|
|
|
|
example_group.extend(self)
|
|
|
|
end
|
2013-10-21 00:41:30 +00:00
|
|
|
|
2014-10-27 00:51:42 +00:00
|
|
|
def rails_version
|
2015-01-21 22:46:26 +00:00
|
|
|
Tests::Version.new(Rails::VERSION::STRING)
|
2014-10-27 00:51:42 +00:00
|
|
|
end
|
2013-10-21 00:41:30 +00:00
|
|
|
|
2014-10-27 00:51:42 +00:00
|
|
|
def rails_3_x?
|
2015-01-21 22:46:26 +00:00
|
|
|
rails_version =~ '~> 3.0'
|
2014-10-27 00:51:42 +00:00
|
|
|
end
|
2014-04-20 02:48:43 +00:00
|
|
|
|
2014-10-27 00:51:42 +00:00
|
|
|
def rails_4_x?
|
2015-01-21 22:46:26 +00:00
|
|
|
rails_version =~ '~> 4.0'
|
2014-10-27 00:51:42 +00:00
|
|
|
end
|
2013-12-31 19:54:21 +00:00
|
|
|
|
2014-10-27 00:51:42 +00:00
|
|
|
def rails_gte_4_1?
|
2015-01-21 22:46:26 +00:00
|
|
|
rails_version >= 4.1
|
2014-10-27 00:51:42 +00:00
|
|
|
end
|
2015-04-09 14:27:26 +00:00
|
|
|
|
|
|
|
def rails_gte_4_2?
|
|
|
|
rails_version >= 4.2
|
|
|
|
end
|
2014-10-27 00:51:42 +00:00
|
|
|
end
|
2013-10-21 00:41:30 +00:00
|
|
|
end
|