lib/rspec_overview/formatter.rb in rspec_overview-0.2.0 vs lib/rspec_overview/formatter.rb in rspec_overview-0.3.0
- old
+ new
@@ -1,7 +1,7 @@
require "rspec/core"
-require_relative "output/table"
+require_relative "output/markdown_table"
require_relative "result"
module RspecOverview
class Formatter
RSpec::Core::Formatters.register self, :dump_summary
@@ -41,16 +41,16 @@
headings = [
column_name, "Example count", "Duration (s)", "Average per example (s)"
]
- output_format.generate(
- output: output,
- title: "Summary by #{column_name}",
+ output.puts "\n# Summary by #{column_name}\n\n"
+ output.puts output_format.new(
headings: headings,
rows: results_as_rows(results),
)
+ output.puts "\n"
end
def extract_subfolder(file_path)
file_path.slice(/.\/[^\/]+\/[^\/]+/)
end
@@ -61,9 +61,9 @@
.reverse_each
.map(&:to_a)
end
def output_format
- RspecOverview::Output::Table.new
+ RspecOverview::Output::MarkdownTable
end
end
end