Class: CemAcpt::TestRunner::TestResults::TestActionResult

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_formatterObject (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

#resultObject (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

Returns:

  • (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

Returns:

  • (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