Class: Ubazu::Rspec::Matchers::ActiveRecord::ValidationMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/ubazu/rspec/matchers/active_record/validation_matcher.rb

Overview

:nodoc:

Direct Known Subclasses

ValidateInclusionOfMatcher

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute) ⇒ ValidationMatcher

Returns a new instance of ValidationMatcher.



10
11
12
# File 'lib/ubazu/rspec/matchers/active_record/validation_matcher.rb', line 10

def initialize(attribute)
  @attribute = attribute
end

Instance Attribute Details

#failure_messageObject (readonly)

Returns the value of attribute failure_message.



8
9
10
# File 'lib/ubazu/rspec/matchers/active_record/validation_matcher.rb', line 8

def failure_message
  @failure_message
end

Instance Method Details

#matches?(subject) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/ubazu/rspec/matchers/active_record/validation_matcher.rb', line 18

def matches?(subject)
  @subject = subject
  false
end

#negative_failure_messageObject



14
15
16
# File 'lib/ubazu/rspec/matchers/active_record/validation_matcher.rb', line 14

def negative_failure_message
  @negative_failure_message || @failure_message
end