Class: Shoulda::Matchers::ActiveModel::DisallowValueMatcher
- Inherits:
-
Object
- Object
- Shoulda::Matchers::ActiveModel::DisallowValueMatcher
- Extended by:
- Forwardable
- Defined in:
- lib/shoulda/matchers/active_model/disallow_value_matcher.rb
Instance Method Summary collapse
- #does_not_match?(subject) ⇒ Boolean
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
- #for(attribute) ⇒ Object
- #ignoring_interference_by_writer(value = :always) ⇒ Object
-
#initialize(value) ⇒ DisallowValueMatcher
constructor
A new instance of DisallowValueMatcher.
- #matches?(subject) ⇒ Boolean
- #on(context) ⇒ Object
- #strict(strict = true) ⇒ Object
- #with_message(message, options = {}) ⇒ Object
Constructor Details
#initialize(value) ⇒ DisallowValueMatcher
Returns a new instance of DisallowValueMatcher.
27 28 29 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 27 def initialize(value) @allow_matcher = AllowValueMatcher.new(value) end |
Instance Method Details
#does_not_match?(subject) ⇒ Boolean
35 36 37 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 35 def does_not_match?(subject) allow_matcher.matches?(subject) end |
#failure_message ⇒ Object
64 65 66 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 64 def allow_matcher. end |
#failure_message_when_negated ⇒ Object
68 69 70 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 68 def allow_matcher. end |
#for(attribute) ⇒ Object
39 40 41 42 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 39 def for(attribute) allow_matcher.for(attribute) self end |
#ignoring_interference_by_writer(value = :always) ⇒ Object
59 60 61 62 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 59 def ignoring_interference_by_writer(value = :always) allow_matcher.ignoring_interference_by_writer(value) self end |
#matches?(subject) ⇒ Boolean
31 32 33 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 31 def matches?(subject) allow_matcher.does_not_match?(subject) end |
#on(context) ⇒ Object
44 45 46 47 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 44 def on(context) allow_matcher.on(context) self end |
#strict(strict = true) ⇒ Object
54 55 56 57 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 54 def strict(strict = true) allow_matcher.strict(strict) self end |
#with_message(message, options = {}) ⇒ Object
49 50 51 52 |
# File 'lib/shoulda/matchers/active_model/disallow_value_matcher.rb', line 49 def (, = {}) allow_matcher.(, ) self end |