Sha256: c8644813e010f2a398302c0c2c929eeadfd3808ae98661f3d9caad6258ec2b76

Contents?: true

Size: 883 Bytes

Versions: 10

Compression:

Stored size: 883 Bytes

Contents

module Shoulda # :nodoc:
  module Matchers
    module ActiveModel # :nodoc:
      class DisallowValueMatcher # :nodoc:
        def initialize(value)
          @allow_matcher = AllowValueMatcher.new(value)
        end

        def matches?(subject)
          !@allow_matcher.matches?(subject)
        end

        def for(attribute)
          @allow_matcher.for(attribute)
          self
        end

        def with_message(message)
          @allow_matcher.with_message(message)
          self
        end

        def failure_message_for_should
          @allow_matcher.failure_message_for_should_not
        end

        def failure_message_for_should_not
          @allow_matcher.failure_message_for_should
        end

        def allowed_types
          ''
        end

        def strict
          @allow_matcher.strict
          self
        end
      end
    end
  end
end

Version data entries

10 entries across 9 versions & 2 rubygems

Version Path
challah-1.0.0 vendor/bundle/gems/shoulda-matchers-2.2.0/lib/shoulda/matchers/active_model/disallow_value_matcher.rb
shoulda-matchers-2.2.0 lib/shoulda/matchers/active_model/disallow_value_matcher.rb
challah-1.0.0.beta3 vendor/bundle/gems/shoulda-matchers-2.1.0/lib/shoulda/matchers/active_model/disallow_value_matcher.rb
challah-1.0.0.beta3 vendor/bundle/gems/shoulda-matchers-1.5.6/lib/shoulda/matchers/active_model/disallow_value_matcher.rb
shoulda-matchers-2.1.0 lib/shoulda/matchers/active_model/disallow_value_matcher.rb
challah-1.0.0.beta2 vendor/bundle/gems/shoulda-matchers-1.5.6/lib/shoulda/matchers/active_model/disallow_value_matcher.rb
challah-1.0.0.beta vendor/bundle/gems/shoulda-matchers-1.5.6/lib/shoulda/matchers/active_model/disallow_value_matcher.rb
shoulda-matchers-2.0.0 lib/shoulda/matchers/active_model/disallow_value_matcher.rb
shoulda-matchers-1.5.6 lib/shoulda/matchers/active_model/disallow_value_matcher.rb
shoulda-matchers-1.5.5 lib/shoulda/matchers/active_model/disallow_value_matcher.rb