require 'simplecov' SimpleCov.command_name 'Unit Tests' SimpleCov.start do add_filter "test/" add_filter "vendor/" add_group "Generator", "lib/generator" add_group "Engine", "lib/hquery" end class SimpleCov::Formatter::QualityFormatter def format(result) SimpleCov::Formatter::HTMLFormatter.new.format(result) File.open("coverage/covered_percent", "w") do |f| f.puts result.source_files.covered_percent.to_f end end end SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter