Class: CucumberTimingPresenter::AllUsageResultsHtmlPresenter

Inherits:
UsageRecordHtmlPresenter show all
Defined in:
lib/cucumber_timing_presenter/all_usage_results_html_presenter.rb

Instance Method Summary collapse

Methods inherited from UsageRecordHtmlPresenter

#format_all, #format_unused_steps, #format_usage

Constructor Details

#initialize(usage_record) ⇒ AllUsageResultsHtmlPresenter

Returns a new instance of AllUsageResultsHtmlPresenter.



3
4
5
# File 'lib/cucumber_timing_presenter/all_usage_results_html_presenter.rb', line 3

def initialize usage_record
  generate_html usage_record
end

Instance Method Details

#generate_html(usage) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/cucumber_timing_presenter/all_usage_results_html_presenter.rb', line 7

def generate_html usage
  html = HtmlTemplate.new Configuration.usage_template_path
  html.replace "PP_STEP_HIGHEST_AVERAGE", format_usage(usage.highest_average)
  html.replace "PP_STEP_HIGHEST_ELAPSED_TIME", format_usage(usage.highest_elapsed_time)
  html.replace "PP_STEP_GREATEST_VARIATION", format_usage(usage.greatest_variation)
  html.replace "PP_ALL_STEPS", format_all(usage.all)
  html.output "all_usage_results.html"
end