Class: React::Test::Matchers::RenderHTMLMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/react/test/matchers/render_html_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ RenderHTMLMatcher

Returns a new instance of RenderHTMLMatcher.



5
6
7
8
# File 'lib/react/test/matchers/render_html_matcher.rb', line 5

def initialize(expected)
  @expected = expected
  @params = {}
end

Instance Method Details

#failure_messageObject



21
22
23
# File 'lib/react/test/matchers/render_html_matcher.rb', line 21

def failure_message
  failure_string
end

#failure_message_when_negatedObject Also known as: negative_failure_message



25
26
27
# File 'lib/react/test/matchers/render_html_matcher.rb', line 25

def failure_message_when_negated
  failure_string(:negative)
end

#matches?(component) ⇒ Boolean

Returns:



15
16
17
18
19
# File 'lib/react/test/matchers/render_html_matcher.rb', line 15

def matches?(component)
  @component = component
  @actual = render_to_html
  @expected == @actual
end

#with_params(params) ⇒ Object



10
11
12
13
# File 'lib/react/test/matchers/render_html_matcher.rb', line 10

def with_params(params)
  @params = params
  self
end