Class: GreenPepper::WriteSurplusExampleResult

Inherits:
FailureExampleResult show all
Defined in:
lib/greenpepper/writer/htmlresult.rb

Instance Attribute Summary collapse

Attributes inherited from HtmlExampleResult

#column, #row

Attributes inherited from ExampleResult

#silent

Instance Method Summary collapse

Methods inherited from FailureExampleResult

#failure?

Methods inherited from ExampleResult

#error?, #failure?, #ignored?, #success?, #update_stats

Constructor Details

#initialize(value, silent = false) ⇒ WriteSurplusExampleResult

Returns a new instance of WriteSurplusExampleResult.



176
177
178
179
# File 'lib/greenpepper/writer/htmlresult.rb', line 176

def initialize(value, silent=false)
  super(silent)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



175
176
177
# File 'lib/greenpepper/writer/htmlresult.rb', line 175

def value
  @value
end

Instance Method Details

#write(cell, options = {}) ⇒ Object



181
182
183
184
185
186
187
188
189
# File 'lib/greenpepper/writer/htmlresult.rb', line 181

def write(cell, options = {})
  super(cell, options)
  surplus = LibXML::XML::Node.new('i')
  surplus << "Surplus "

  cell.content = ""
  cell << surplus
  cell << @value
end