Class: ViewMatchers::FormMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/view_matchers/form_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ FormMatcher

Returns a new instance of FormMatcher.



5
6
7
# File 'lib/view_matchers/form_matcher.rb', line 5

def initialize(expected)
  @expected = Form.new(expected)
end

Instance Method Details

#failure_messageObject



13
14
15
16
# File 'lib/view_matchers/form_matcher.rb', line 13

def failure_message
  "the following expected tags did not exist:\n" <<
    failure_messages
end

#failure_message_when_negatedObject



18
19
20
21
# File 'lib/view_matchers/form_matcher.rb', line 18

def failure_message_when_negated
  "the following not expected tags actually did exist:\n" <<
    failure_messages
end

#matches?(rendered) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/view_matchers/form_matcher.rb', line 9

def matches?(rendered)
  expectation_exists_in_rendered? rendered
end