Class: TestBench::Run::Summary::FileInfo
- Inherits:
-
Struct
- Object
- Struct
- TestBench::Run::Summary::FileInfo
- Defined in:
- lib/test_bench/run/summary.rb
Instance Attribute Summary collapse
-
#aborted_events ⇒ Object
Returns the value of attribute aborted_events.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#not_found ⇒ Object
Returns the value of attribute not_found.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
- #errors ⇒ Object
- #errors? ⇒ Boolean
- #failed? ⇒ Boolean
- #failures ⇒ Object
- #failures? ⇒ Boolean
- #not_found? ⇒ Boolean
- #skipped ⇒ Object
- #skipped? ⇒ Boolean
- #tests? ⇒ Boolean
- #update(event) ⇒ Object
Instance Attribute Details
#aborted_events ⇒ Object
Returns the value of attribute aborted_events
352 353 354 |
# File 'lib/test_bench/run/summary.rb', line 352 def aborted_events @aborted_events end |
#file_path ⇒ Object
Returns the value of attribute file_path
352 353 354 |
# File 'lib/test_bench/run/summary.rb', line 352 def file_path @file_path end |
#not_found ⇒ Object
Returns the value of attribute not_found
352 353 354 |
# File 'lib/test_bench/run/summary.rb', line 352 def not_found @not_found end |
#status ⇒ Object
Returns the value of attribute status
352 353 354 |
# File 'lib/test_bench/run/summary.rb', line 352 def status @status end |
Class Method Details
.initial(file_path) ⇒ Object
353 354 355 356 357 358 359 |
# File 'lib/test_bench/run/summary.rb', line 353 def self.initial(file_path) status = Session::Status.initial aborted_events = [] new(file_path, status, aborted_events) end |
.not_found(file_path) ⇒ Object
361 362 363 364 365 |
# File 'lib/test_bench/run/summary.rb', line 361 def self.not_found(file_path) instance = new(file_path) instance.not_found = true instance end |
Instance Method Details
#errors ⇒ Object
416 417 418 419 420 |
# File 'lib/test_bench/run/summary.rb', line 416 def errors errors = aborted_events.count "%i error#{'s' if errors != 1}:" % errors end |
#errors? ⇒ Boolean
412 413 414 |
# File 'lib/test_bench/run/summary.rb', line 412 def errors? aborted_events.any? end |
#failed? ⇒ Boolean
375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/test_bench/run/summary.rb', line 375 def failed? if not_found? return true end case status.result when Session::Result.failed, Session::Result.aborted true else false end end |
#failures ⇒ Object
396 397 398 399 400 |
# File 'lib/test_bench/run/summary.rb', line 396 def failures failures = status.failure_sequence "%i failure#{'s' if failures != 1}" % failures end |
#failures? ⇒ Boolean
392 393 394 |
# File 'lib/test_bench/run/summary.rb', line 392 def failures? status.failure_sequence > 0 end |
#not_found? ⇒ Boolean
422 423 424 |
# File 'lib/test_bench/run/summary.rb', line 422 def not_found? not_found ? true : false end |
#skipped ⇒ Object
406 407 408 409 410 |
# File 'lib/test_bench/run/summary.rb', line 406 def skipped skipped = status.skip_sequence "%i+ skipped" % skipped end |
#skipped? ⇒ Boolean
402 403 404 |
# File 'lib/test_bench/run/summary.rb', line 402 def skipped? status.skip_sequence > 0 end |
#tests? ⇒ Boolean
388 389 390 |
# File 'lib/test_bench/run/summary.rb', line 388 def tests? status.test_sequence > 0 end |
#update(event) ⇒ Object
367 368 369 370 371 372 373 |
# File 'lib/test_bench/run/summary.rb', line 367 def update(event) status.update(event) if event in Aborted => aborted self.aborted_events << aborted end end |