Class: CIRunner::TestFailure

Inherits:
Object
  • Object
show all
Includes:
DRbUndumped
Defined in:
lib/ci_runner/test_failure.rb

Overview

A container object to gather test failures as we parse the CI log output.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, test_name, path) ⇒ TestFailure

Returns a new instance of TestFailure.

Parameters:



30
31
32
33
34
# File 'lib/ci_runner/test_failure.rb', line 30

def initialize(klass, test_name, path)
  @klass = klass
  @test_name = test_name
  @path = absolute_path(Pathname(path))
end

Instance Attribute Details

#klassString (readonly)

Returns The name of the class that included the failing test.

Examples:

Given a output log: “TestReloading#test_reload_recovers_from_name_errors__w__on_unload_callbacks”.

puts klass # => TestReloading

Returns:

  • (String)

    The name of the class that included the failing test.



16
17
18
# File 'lib/ci_runner/test_failure.rb', line 16

def klass
  @klass
end

#pathString (readonly)

Returns The file location where this klass lives.

Returns:

  • (String)

    The file location where this klass lives.



25
26
27
# File 'lib/ci_runner/test_failure.rb', line 25

def path
  @path
end

#test_nameString (readonly)

Returns The name of the test that failed.

Examples:

Given a output log: “TestReloading#test_reload_recovers_from_name_errors__w__on_unload_callbacks”.

puts test_name # => test_reload_recovers_from_name_errors__w__on_unload_callbacks

Returns:

  • (String)

    The name of the test that failed.



22
23
24
# File 'lib/ci_runner/test_failure.rb', line 22

def test_name
  @test_name
end