thoughtbot--shoulda-matchers/lib/shoulda/matchers/rails_shim.rb

27 lines
447 B
Ruby
Raw Normal View History

module Shoulda # :nodoc:
module Matchers
class RailsShim # :nodoc:
def self.layouts_ivar
if rails_major_version >= 4
'@_layouts'
else
'@layouts'
end
end
def self.flashes_ivar
if rails_major_version >= 4
:@flashes
else
:@used
end
end
def self.rails_major_version
Rails::VERSION::MAJOR
end
end
end
end