Class: CemAcpt::TestRunner::TestResults::TestActionResult
- Inherits:
-
Object
- Object
- CemAcpt::TestRunner::TestResults::TestActionResult
- Defined in:
- lib/cem_acpt/test_runner/test_results.rb
Overview
Wrapper class for the result of an action. Provides a common interface for getting reportable data from the result.
Instance Attribute Summary collapse
-
#log_formatter ⇒ Object
readonly
Returns the value of attribute log_formatter.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(result, log_formatter = nil) ⇒ TestActionResult
constructor
A new instance of TestActionResult.
- #method_missing(method_name, *args, **kwargs, &block) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(result, log_formatter = nil) ⇒ TestActionResult
Returns a new instance of TestActionResult.
71 72 73 74 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 71 def initialize(result, log_formatter = nil) @result = result @log_formatter = log_formatter end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, **kwargs, &block) ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 80 def method_missing(method_name, *args, **kwargs, &block) if @result.respond_to?(method_name) @result.send(method_name, *args, **kwargs, &block) else super end end |
Instance Attribute Details
#log_formatter ⇒ Object (readonly)
Returns the value of attribute log_formatter.
69 70 71 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 69 def log_formatter @log_formatter end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
69 70 71 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 69 def result @result end |
Instance Method Details
#error? ⇒ Boolean
76 77 78 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 76 def error? (@result.respond_to?(:error?) && @result.error?) || false end |
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
88 89 90 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 88 def respond_to_missing?(method_name, include_private = false) @result.respond_to?(method_name, include_private) || super end |