Class: GreenPepper::WriteExpectedExampleResult
- Inherits:
-
FailureExampleResult
- Object
- ExampleResult
- HtmlExampleResult
- FailureExampleResult
- GreenPepper::WriteExpectedExampleResult
- Defined in:
- lib/greenpepper/writer/htmlresult.rb
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#received ⇒ Object
readonly
Returns the value of attribute received.
Attributes inherited from HtmlExampleResult
Attributes inherited from ExampleResult
Instance Method Summary collapse
-
#initialize(expected, received, silent = false) ⇒ WriteExpectedExampleResult
constructor
A new instance of WriteExpectedExampleResult.
- #write(cell, options = {}) ⇒ Object
Methods inherited from FailureExampleResult
Methods inherited from ExampleResult
#error?, #failure?, #ignored?, #success?, #update_stats
Constructor Details
#initialize(expected, received, silent = false) ⇒ WriteExpectedExampleResult
Returns a new instance of WriteExpectedExampleResult.
114 115 116 117 118 |
# File 'lib/greenpepper/writer/htmlresult.rb', line 114 def initialize(expected, received, silent=false) super(silent) @expected = expected @received = received end |
Instance Attribute Details
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
113 114 115 |
# File 'lib/greenpepper/writer/htmlresult.rb', line 113 def expected @expected end |
#received ⇒ Object (readonly)
Returns the value of attribute received.
113 114 115 |
# File 'lib/greenpepper/writer/htmlresult.rb', line 113 def received @received end |
Instance Method Details
#write(cell, options = {}) ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/greenpepper/writer/htmlresult.rb', line 120 def write(cell, = {}) cell = super(cell, ) cell.children.each{|current_node|current_node.remove!} cell << LibXML::XML::Node.new_text("") expected_node = LibXML::XML::Node.new "b", "Expected: " cell << expected_node cell << @expected received_node = LibXML::XML::Node.new "b", " Received: " cell << received_node cell << @received end |