Class: Fat::StandardAnnotationFixture
- Inherits:
-
Fit::ColumnFixture
- Object
- Fit::Fixture
- Fit::ColumnFixture
- Fat::StandardAnnotationFixture
- Defined in:
- lib/fat/standard_annotation_fixture.rb
Constant Summary
Constants inherited from Fit::Fixture
Fit::Fixture::GRAY, Fit::Fixture::GREEN, Fit::Fixture::RED, Fit::Fixture::YELLOW
Instance Attribute Summary collapse
-
#annotation ⇒ Object
Returns the value of attribute annotation.
-
#original_html ⇒ Object
Returns the value of attribute original_html.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from Fit::Fixture
#args, #counts, #listener, #summary
Instance Method Summary collapse
- #do_cell(cell, column) ⇒ Object
-
#initialize ⇒ StandardAnnotationFixture
constructor
A new instance of StandardAnnotationFixture.
- #output ⇒ Object
- #rendered_output ⇒ Object
Methods inherited from Fit::ColumnFixture
#check, #do_row, #do_rows, #execute, #reset
Methods inherited from Fit::Fixture
camel, #check, #do_cells, #do_row, #do_rows, #do_table, #do_tables, #error, escape, #exception, #find_class, #fixture_name, #get_args_for_table, #get_linked_fixture_with_args, gray, #ignore, #info, #interpret_following_tables, #interpret_tables, label, metadata, #parse, #right, #total_errors, #totals, #wrong
Constructor Details
#initialize ⇒ StandardAnnotationFixture
Returns a new instance of StandardAnnotationFixture.
13 14 15 16 |
# File 'lib/fat/standard_annotation_fixture.rb', line 13 def initialize super @original_html = 'Text' end |
Instance Attribute Details
#annotation ⇒ Object
Returns the value of attribute annotation.
11 12 13 |
# File 'lib/fat/standard_annotation_fixture.rb', line 11 def annotation @annotation end |
#original_html ⇒ Object
Returns the value of attribute original_html.
11 12 13 |
# File 'lib/fat/standard_annotation_fixture.rb', line 11 def original_html @original_html end |
#text ⇒ Object
Returns the value of attribute text.
11 12 13 |
# File 'lib/fat/standard_annotation_fixture.rb', line 11 def text @text end |
Instance Method Details
#do_cell(cell, column) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fat/standard_annotation_fixture.rb', line 32 def do_cell cell, column begin if column == 4 cell.body = rendered_output else super end rescue Exception => e exception cell, e end end |
#output ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fat/standard_annotation_fixture.rb', line 18 def output parse = Fit::Parse.new @original_html, ['td'] testbed = Fit::Fixture.new case @annotation when 'right' then testbed.right(parse) when 'wrong' then testbed.wrong(parse, @text) when 'error' then testbed.error(parse, @text) when 'info' then testbed.info(parse, @text) when 'ignore' then testbed.ignore(parse) else return "unknown type: #@type" end generate_output parse end |
#rendered_output ⇒ Object
44 45 46 |
# File 'lib/fat/standard_annotation_fixture.rb', line 44 def rendered_output '<table border="1"><tr>' + output + '</tr></table>' end |