Skip to content

Instantly share code, notes, and snippets.

@petyosi
petyosi / gist:314334
Created February 25, 2010 07:31 — forked from clayton/gist:89659
# From http://github.com/jaymcgavren
#
# Save this as rcov.rake in lib/tasks and use rcov:all =>
# to get accurate spec/feature coverage data
require 'cucumber/rake/task'
require 'spec/rake/spectask'
namespace :rcov do
Cucumber::Rake::Task.new(:cucumber) do |t|
win_coef = self.win(profile, scope).to_f/100
avg_win_coef = self.average(profile, scope, :wins)
avg_lose_coef = self.average(profile, scope, :losses)
(win_coef * avg_win_coef) + ((100 - win_coef) * (-avg_lose_coef)).to_i