Sha256: c83abf050af8b36c76f3fa95def6095509f3c899e0ef282e68f8e8a994e8e598

Contents?: true

Size: 709 Bytes

Versions: 10

Compression:

Stored size: 709 Bytes

Contents

module UnitTests
  module ActiveModelVersions
    def self.configure_example_group(example_group)
      example_group.include(self)
      example_group.extend(self)
    end

    def active_model_version
      Tests::Version.new(::ActiveModel::VERSION::STRING)
    end

    def active_model_3_1?
      (::ActiveModel::VERSION::MAJOR == 3 && ::ActiveModel::VERSION::MINOR >= 1) || active_model_4_0?
    end

    def active_model_3_2?
      (::ActiveModel::VERSION::MAJOR == 3 && ::ActiveModel::VERSION::MINOR >= 2) || active_model_4_0?
    end

    def active_model_4_0?
      ::ActiveModel::VERSION::MAJOR == 4
    end

    def active_model_supports_strict?
      active_model_version >= 3.2
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
shoulda-matchers-3.1.3 spec/support/unit/helpers/active_model_versions.rb
shoulda-matchers-3.1.2 spec/support/unit/helpers/active_model_versions.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/shoulda-matchers-2.8.0/spec/support/unit/helpers/active_model_versions.rb
shoulda-matchers-3.1.1 spec/support/unit/helpers/active_model_versions.rb
shoulda-matchers-3.1.0 spec/support/unit/helpers/active_model_versions.rb
shoulda-matchers-3.0.1 spec/support/unit/helpers/active_model_versions.rb
shoulda-matchers-3.0.0 spec/support/unit/helpers/active_model_versions.rb
shoulda-matchers-3.0.0.rc1 spec/support/unit/helpers/active_model_versions.rb
shoulda-matchers-2.8.0 spec/support/unit/helpers/active_model_versions.rb
shoulda-matchers-2.8.0.rc2 spec/support/unit/helpers/active_model_versions.rb