diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..372b5ac --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--warnings diff --git a/lib/simplecov_json_formatter/source_file_formatter.rb b/lib/simplecov_json_formatter/source_file_formatter.rb index 3564c79..6f44f52 100644 --- a/lib/simplecov_json_formatter/source_file_formatter.rb +++ b/lib/simplecov_json_formatter/source_file_formatter.rb @@ -4,6 +4,7 @@ module SimpleCovJSONFormatter class SourceFileFormatter def initialize(source_file) @source_file = source_file + @line_coverage = nil end def format @@ -17,7 +18,7 @@ def format private def line_coverage - @line_coverage || { + @line_coverage ||= { lines: lines } end