Class: Grntest::TestResult
- Inherits:
-
BaseResult
- Object
- BaseResult
- Grntest::TestResult
- Defined in:
- lib/grntest/test-runner.rb
Instance Attribute Summary collapse
-
#actual ⇒ Object
Returns the value of attribute actual.
-
#benchmarks ⇒ Object
Returns the value of attribute benchmarks.
-
#expected ⇒ Object
Returns the value of attribute expected.
-
#n_leaked_objects ⇒ Object
Returns the value of attribute n_leaked_objects.
-
#omitted ⇒ Object
writeonly
Sets the attribute omitted.
-
#test_name ⇒ Object
Returns the value of attribute test_name.
-
#worker_id ⇒ Object
Returns the value of attribute worker_id.
Attributes inherited from BaseResult
#cpu_elapsed_time, #real_elapsed_time
Instance Method Summary collapse
- #checked? ⇒ Boolean
-
#initialize(worker) ⇒ TestResult
constructor
A new instance of TestResult.
- #leaked? ⇒ Boolean
- #omitted? ⇒ Boolean
- #status ⇒ Object
Methods inherited from BaseResult
Constructor Details
#initialize(worker) ⇒ TestResult
Returns a new instance of TestResult.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/grntest/test-runner.rb', line 52 def initialize(worker) super() @worker_id = worker.id @test_name = worker.test_name @actual = nil @expected = nil @n_leaked_objects = 0 @omitted = false @benchmarks = [] end |
Instance Attribute Details
#actual ⇒ Object
Returns the value of attribute actual.
49 50 51 |
# File 'lib/grntest/test-runner.rb', line 49 def actual @actual end |
#benchmarks ⇒ Object
Returns the value of attribute benchmarks.
51 52 53 |
# File 'lib/grntest/test-runner.rb', line 51 def benchmarks @benchmarks end |
#expected ⇒ Object
Returns the value of attribute expected.
49 50 51 |
# File 'lib/grntest/test-runner.rb', line 49 def expected @expected end |
#n_leaked_objects ⇒ Object
Returns the value of attribute n_leaked_objects.
49 50 51 |
# File 'lib/grntest/test-runner.rb', line 49 def n_leaked_objects @n_leaked_objects end |
#omitted=(value) ⇒ Object (writeonly)
Sets the attribute omitted
50 51 52 |
# File 'lib/grntest/test-runner.rb', line 50 def omitted=(value) @omitted = value end |
#test_name ⇒ Object
Returns the value of attribute test_name.
48 49 50 |
# File 'lib/grntest/test-runner.rb', line 48 def test_name @test_name end |
#worker_id ⇒ Object
Returns the value of attribute worker_id.
48 49 50 |
# File 'lib/grntest/test-runner.rb', line 48 def worker_id @worker_id end |
Instance Method Details
#checked? ⇒ Boolean
93 94 95 |
# File 'lib/grntest/test-runner.rb', line 93 def checked? not @expected.nil? end |
#leaked? ⇒ Boolean
89 90 91 |
# File 'lib/grntest/test-runner.rb', line 89 def leaked? not @n_leaked_objects.zero? end |
#omitted? ⇒ Boolean
85 86 87 |
# File 'lib/grntest/test-runner.rb', line 85 def omitted? @omitted end |
#status ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/grntest/test-runner.rb', line 63 def status return :omitted if omitted? if @expected if @actual == @expected if leaked? :leaked else :success end else :failure end else if leaked? :leaked else :not_checked end end end |