Skip to content

Commit

Permalink
Create coverage/covered_percent if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
samwgoldman committed Oct 10, 2014
1 parent 1c7d08b commit 197ac6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
if ENV["COVERAGE"]
require "simplecov"
require "coveralls"
require "fileutils"

class HTMLFormatterWithCoveredPercent
def format(result)
SimpleCov::Formatter::HTMLFormatter.new.format(result)
File.open("coverage/covered_percent", "w") do |f|
FileUtils.mkdir_p("coverage")
File.open("coverage/covered_percent", "w+") do |f|
f.puts result.source_files.covered_percent.to_f
end
end
Expand Down

0 comments on commit 197ac6f

Please sign in to comment.