Class: CIAT::Feedback::HtmlFeedback
- Inherits:
-
Object
- Object
- CIAT::Feedback::HtmlFeedback
- Includes:
- ERBHelpers
- Defined in:
- lib/ciat/feedback/html_feedback.rb
Instance Method Summary collapse
-
#generate_html(suite) ⇒ Object
:nodoc:.
-
#initialize(counter) ⇒ HtmlFeedback
constructor
A new instance of HtmlFeedback.
- #post_tests(suite) ⇒ Object
- #pre_tests(suite) ⇒ Object
- #processor_result(processor) ⇒ Object
-
#template ⇒ Object
:nodoc:.
Methods included from ERBHelpers
#light_to_sentence, #light_to_word, #new_path?, #render, #replace_tabs, #title
Constructor Details
#initialize(counter) ⇒ HtmlFeedback
Returns a new instance of HtmlFeedback.
7 8 9 |
# File 'lib/ciat/feedback/html_feedback.rb', line 7 def initialize(counter) @counter = counter end |
Instance Method Details
#generate_html(suite) ⇒ Object
:nodoc:
25 26 27 28 29 30 31 32 |
# File 'lib/ciat/feedback/html_feedback.rb', line 25 def generate_html(suite) #:nodoc: processors = suite.processors results = suite.results report_title = suite.report_title size = suite.size counter = @counter ERB.new(template).result(binding) end |
#post_tests(suite) ⇒ Object
19 20 21 22 23 |
# File 'lib/ciat/feedback/html_feedback.rb', line 19 def post_tests(suite) suite.cargo.write_file( suite.cargo.report_filename, generate_html(suite)) end |
#pre_tests(suite) ⇒ Object
11 12 13 |
# File 'lib/ciat/feedback/html_feedback.rb', line 11 def pre_tests(suite) suite.cargo.copy_suite_data end |
#processor_result(processor) ⇒ Object
15 16 17 |
# File 'lib/ciat/feedback/html_feedback.rb', line 15 def processor_result(processor) nil end |
#template ⇒ Object
:nodoc:
34 35 36 37 38 |
# File 'lib/ciat/feedback/html_feedback.rb', line 34 def template #:nodoc: File.read(File.join( File.dirname(__FILE__), "..", "..", "templates", "report.html.erb" )) end |