Class: StepStats::Formatter
- Inherits:
-
Cucumber::Formatter::Pretty
- Object
- Cucumber::Formatter::Pretty
- StepStats::Formatter
- Defined in:
- lib/step_stats/step_stats_formatter.rb
Instance Method Summary collapse
- #after_features(*args) ⇒ Object
- #before_step(step) ⇒ Object
- #before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line) ⇒ Object
-
#initialize(step_mother, io, options) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
Instance Method Details
#after_features(*args) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/step_stats/step_stats_formatter.rb', line 22 def after_features(*args) @path = File.dirname(__FILE__) template = File.read(@path+"/template.erb") @data = @sss.stats result = ERB.new(template, 0, "", "@html").result(binding) stats_html_file = File.new('tmp/step_stats.html','w') stats_html_file.write(result) stats_html_file.close super end |
#before_step(step) ⇒ Object
11 12 13 14 |
# File 'lib/step_stats/step_stats_formatter.rb', line 11 def before_step(step) @start_time = Time.now super end |
#before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line) ⇒ Object
16 17 18 19 20 |
# File 'lib/step_stats/step_stats_formatter.rb', line 16 def before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line) @duration = Time.now - @start_time @sss.add_stat(step_match.step_definition,@duration,status,file_colon_line) if @duration > 0 && !step_match.step_definition.nil? super end |