Class: GreenPepper::WriteExceptionExampleResult
- Inherits:
-
ErrorExampleResult
- Object
- ExampleResult
- HtmlExampleResult
- ErrorExampleResult
- GreenPepper::WriteExceptionExampleResult
- Defined in:
- lib/greenpepper/writer/htmlresult.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Attributes inherited from HtmlExampleResult
Attributes inherited from ExampleResult
Instance Method Summary collapse
-
#initialize(exception, silent = false) ⇒ WriteExceptionExampleResult
constructor
A new instance of WriteExceptionExampleResult.
- #write(cell, options = {}) ⇒ Object
Methods inherited from ErrorExampleResult
Methods inherited from ExampleResult
#error?, #failure?, #ignored?, #success?, #update_stats
Constructor Details
#initialize(exception, silent = false) ⇒ WriteExceptionExampleResult
Returns a new instance of WriteExceptionExampleResult.
139 140 141 142 |
# File 'lib/greenpepper/writer/htmlresult.rb', line 139 def initialize(exception, silent=false) super(silent) @exception = exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
137 138 139 |
# File 'lib/greenpepper/writer/htmlresult.rb', line 137 def exception @exception end |
Instance Method Details
#write(cell, options = {}) ⇒ Object
144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/greenpepper/writer/htmlresult.rb', line 144 def write(cell, = {}) cell = super(cell, ) cell.content = "#{@exception.class}: #{@exception.to_s}" if @exception.backtrace && ![:no_exception_stack] cell << LibXML::XML::Node.new('hr') @exception.backtrace.each { |step| cell << step cell << LibXML::XML::Node.new('br') } end cell end |