Class: RoutesCoverage::Formatters::Html

Inherits:
Base
  • Object
show all
Defined in:
lib/routes_coverage/formatters/html.rb

Instance Attribute Summary

Attributes inherited from Base

#groups, #result, #settings

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from RoutesCoverage::Formatters::Base

Instance Method Details

#formatObject



12
13
14
15
16
17
18
19
20
# File 'lib/routes_coverage/formatters/html.rb', line 12

def format
  routes_filename = "routes.html"

  File.open(File.join(output_path, routes_filename), "wb") do |file|
    file.puts template("layout").result(binding)
  end

  "Routes coverage is #{result.coverage}% Report generated to #{output_path}/#{routes_filename}"
end