def write_text(target = self.class.default_target)
      # Open a File Object for IO if target is a string containing a filename or path
      target = File.open(target, 'w') if target.is_a? String
      coverage_report = nil

      events.each do |_tool, tool_events|
        tool_events.each do |event|
          if event.rspec_puppet_coverage?
            coverage_report = event.to_text
          else
            target.puts(event.to_text) unless event.pass?
          end
        end
      end
    ensure
      target.puts "\n#{coverage_report}" if coverage_report
      target.close if target.is_a? File
    end
def write_text(target = self.class.default_target)
      # Open a File Object for IO if target is a string containing a filename or path
      target = File.open(target, 'w') if target.is_a? String
      coverage_report = nil

      events.each do |_tool, tool_events|
        tool_events.each do |event|
          if event.rspec_puppet_coverage?
            coverage_report = event.to_text
          else
            target.puts(event.to_text) unless event.pass?
          end
        end
      end
    ensure
      target.puts "\n#{coverage_report}" if coverage_report
      target.close if target.is_a? File
    end
Renders the report as plain text.

 This report is designed for interactive use by a human and so excludes
 all passing events in order to be consise.

 @param target [#write] an IO object that the report will be written to.
   Defaults to PDK::Report.default_target.