Sha256: 99cbad609a62e44bac660d1f2610c08fbdee4c4bae6237680d5b79c84cf2892e

Contents?: true

Size: 495 Bytes

Versions: 7

Compression:

Stored size: 495 Bytes

Contents

module UnitTests
  module RailsVersions
    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_gte_4_1?
      rails_version >= 4.1
    end

    def rails_gte_4_2?
      rails_version >= 4.2
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shoulda-matchers-3.1.3 spec/support/unit/helpers/rails_versions.rb
shoulda-matchers-3.1.2 spec/support/unit/helpers/rails_versions.rb
shoulda-matchers-3.1.1 spec/support/unit/helpers/rails_versions.rb
shoulda-matchers-3.1.0 spec/support/unit/helpers/rails_versions.rb
shoulda-matchers-3.0.1 spec/support/unit/helpers/rails_versions.rb
shoulda-matchers-3.0.0 spec/support/unit/helpers/rails_versions.rb
shoulda-matchers-3.0.0.rc1 spec/support/unit/helpers/rails_versions.rb