Class: HtmlTestDomHook

Inherits:
Mumukit::Hook
  • Object
show all
Defined in:
lib/test_dom_hook.rb

Instance Method Summary collapse

Instance Method Details

#compile(request) ⇒ Object



8
9
10
# File 'lib/test_dom_hook.rb', line 8

def compile(request)
  request
end

#run!(request) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/test_dom_hook.rb', line 12

def run!(request)
  options = request.options
  expected = expected_html request
  actual = compile_content request

  if is_dom_ok expected, actual, options
    [render_html(actual), :passed]
  else
    [render_fail_html(actual, expected), :failed]
  end
end