Class: TestRunner::TestResult

Inherits:
Object
  • Object
show all
Defined in:
lib/test-runner/test_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test, success, elapsed_time, state_dir) ⇒ TestResult

Returns a new instance of TestResult.



5
6
7
8
9
10
# File 'lib/test-runner/test_result.rb', line 5

def initialize(test, success, elapsed_time, state_dir)
  @test = test
  @success = success
  @elapsed_time = elapsed_time
  @state_dir = state_dir
end

Instance Attribute Details

#elapsed_timeObject (readonly)

Returns the value of attribute elapsed_time.



3
4
5
# File 'lib/test-runner/test_result.rb', line 3

def elapsed_time
  @elapsed_time
end

#state_dirObject (readonly)

Returns the value of attribute state_dir.



3
4
5
# File 'lib/test-runner/test_result.rb', line 3

def state_dir
  @state_dir
end

#successObject (readonly)

Returns the value of attribute success.



3
4
5
# File 'lib/test-runner/test_result.rb', line 3

def success
  @success
end

#testObject (readonly)

Returns the value of attribute test.



3
4
5
# File 'lib/test-runner/test_result.rb', line 3

def test
  @test
end

Instance Method Details

#expected_result?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
25
26
# File 'lib/test-runner/test_result.rb', line 20

def expected_result?
  if test.expect_failure
    !@success
  else
    @success
  end
end

#expected_to_fail?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/test-runner/test_result.rb', line 36

def expected_to_fail?
  test.expect_failure
end

#expected_to_succeed?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/test-runner/test_result.rb', line 32

def expected_to_succeed?
  !test.expect_failure
end

#failed?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/test-runner/test_result.rb', line 16

def failed?
  !@success
end

#successful?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/test-runner/test_result.rb', line 12

def successful?
  @success
end

#unexpected_result?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/test-runner/test_result.rb', line 28

def unexpected_result?
  !expected_result?
end