Class: FormObjectModel::FormObjectHaveValueMatcher

Inherits:
Struct
  • Object
show all
Defined in:
lib/form_object_model/matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actualObject (readonly)

Returns the value of attribute actual.



3
4
5
# File 'lib/form_object_model/matcher.rb', line 3

def actual
  @actual
end

#valueObject

Returns the value of attribute value



2
3
4
# File 'lib/form_object_model/matcher.rb', line 2

def value
  @value
end

Instance Method Details

#failure_message_for_shouldObject



10
11
12
# File 'lib/form_object_model/matcher.rb', line 10

def failure_message_for_should
  "Expected field '#{actual.locator}' to have value '#{value}' but had '#{actual.value}'"
end

#matches?(actual) ⇒ Boolean



5
6
7
8
# File 'lib/form_object_model/matcher.rb', line 5

def matches?(actual)
  @actual = actual
  actual.has_value?(value)
end