Skip to content

Commit c2d3e29

Browse files
committed
add @code_total and @tests_total to output in json
1 parent 00ccb50 commit c2d3e29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rails_stats/json_formatter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ class JSONFormatter < StatsFormatter
55
def result
66
@result = @statistics.map { |key, stats| stat_hash(key, stats) }
77

8-
if @grand_total
9-
@result << stat_hash("Total", @grand_total).merge(code_test_hash)
10-
end
8+
@result << stat_hash("Total", @grand_total).merge(code_test_hash) if @grand_total
9+
@result << stat_hash("Total", @tests_total).merge(code_test_hash) if @tests_total
10+
@result << stat_hash("Total", @code_total).merge(code_test_hash) if @code_total
1111

1212
@result
1313
end

0 commit comments

Comments
 (0)