Class: RSpecTracer::HTMLReporter::Reporter
- Inherits:
-
Object
- Object
- RSpecTracer::HTMLReporter::Reporter
- Defined in:
- lib/rspec_tracer/html_reporter/reporter.rb
Instance Attribute Summary collapse
-
#examples ⇒ Object
readonly
Returns the value of attribute examples.
-
#examples_dependency ⇒ Object
readonly
Returns the value of attribute examples_dependency.
-
#files_dependency ⇒ Object
readonly
Returns the value of attribute files_dependency.
-
#flaky_examples ⇒ Object
readonly
Returns the value of attribute flaky_examples.
-
#last_run ⇒ Object
readonly
Returns the value of attribute last_run.
Instance Method Summary collapse
- #generate_report ⇒ Object
-
#initialize(report_dir, reporter) ⇒ Reporter
constructor
A new instance of Reporter.
Constructor Details
#initialize(report_dir, reporter) ⇒ Reporter
Returns a new instance of Reporter.
11 12 13 14 |
# File 'lib/rspec_tracer/html_reporter/reporter.rb', line 11 def initialize(report_dir, reporter) @report_dir = report_dir @reporter = reporter end |
Instance Attribute Details
#examples ⇒ Object (readonly)
Returns the value of attribute examples.
9 10 11 |
# File 'lib/rspec_tracer/html_reporter/reporter.rb', line 9 def examples @examples end |
#examples_dependency ⇒ Object (readonly)
Returns the value of attribute examples_dependency.
9 10 11 |
# File 'lib/rspec_tracer/html_reporter/reporter.rb', line 9 def examples_dependency @examples_dependency end |
#files_dependency ⇒ Object (readonly)
Returns the value of attribute files_dependency.
9 10 11 |
# File 'lib/rspec_tracer/html_reporter/reporter.rb', line 9 def files_dependency @files_dependency end |
#flaky_examples ⇒ Object (readonly)
Returns the value of attribute flaky_examples.
9 10 11 |
# File 'lib/rspec_tracer/html_reporter/reporter.rb', line 9 def flaky_examples @flaky_examples end |
#last_run ⇒ Object (readonly)
Returns the value of attribute last_run.
9 10 11 |
# File 'lib/rspec_tracer/html_reporter/reporter.rb', line 9 def last_run @last_run end |
Instance Method Details
#generate_report ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rspec_tracer/html_reporter/reporter.rb', line 16 def generate_report starting = Process.clock_gettime(Process::CLOCK_MONOTONIC) prepare file_name = File.join(@report_dir, 'index.html') File.open(file_name, 'wb') do |file| file.puts(template('layout').result(binding)) end ending = Process.clock_gettime(Process::CLOCK_MONOTONIC) elapsed = RSpecTracer::TimeFormatter.format_time(ending - starting) puts "RSpecTracer generated HTML report to #{file_name} (took #{elapsed})" end |