Class: Maze::Plugins::ErrorCodePlugin

Inherits:
Object
  • Object
show all
Defined in:
lib/maze/plugins/error_code_plugin.rb

Instance Method Summary collapse

Instance Method Details

#test_case(test_case) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/maze/plugins/error_code_plugin.rb', line 7

def test_case(test_case)
  configuration.on_event(:test_case_finished) do |event|

    # Ensure we're in the correct test case, and the test failed
    next unless event.test_case == test_case

    error = event.result.failed? ? event.result.exception.class : nil
    Maze::Hooks::ErrorCodeHook.last_test_error_class = error
  end

  super
end