Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove rcov

  • Loading branch information...
commit 325282e64a897cd92c78d44d48726fe16486f84a 1 parent b117ad1
@twalpole twalpole authored
Showing with 0 additions and 62 deletions.
  1. +0 −17 Rakefile
  2. +0 −1  formtastic.gemspec
  3. +0 −44 lib/tasks/verify_rcov.rb
View
17 Rakefile
@@ -3,7 +3,6 @@ require 'bundler/setup'
require 'appraisal'
require 'rdoc/task'
require 'rspec/core/rake_task'
-require 'tasks/verify_rcov'
Bundler::GemHelper.install_tasks
@@ -38,19 +37,3 @@ desc 'Test the formtastic plugin with specdoc formatting and colors'
RSpec::Core::RakeTask.new('specdoc') do |t|
t.pattern = FileList['spec/**/*_spec.rb']
end
-
-desc 'Run all examples with RCov'
-RSpec::Core::RakeTask.new('rcov') do |t|
- t.pattern = FileList['spec/**/*_spec.rb']
- t.rcov = true
- t.rcov_opts = %w(--exclude gems/*,spec/*,.bundle/*, --aggregate coverage.data)
-end
-
-RCov::VerifyTask.new(:verify_coverage) do |t|
- t.require_exact_threshold = false
- t.threshold = (RUBY_VERSION == "1.8.7" ? 95 : 0)
-end
-
-desc "Run all examples and verify coverage"
-task :spec_and_verify_coverage => [:rcov, :verify_coverage] do
-end
View
1  formtastic.gemspec
@@ -30,7 +30,6 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<hpricot>, ["~> 0.8.3"])
s.add_development_dependency(%q<BlueCloth>) # for YARD
s.add_development_dependency(%q<yard>, ["~> 0.6"])
- s.add_development_dependency(%q<rcov>, ["~> 0.9.9"]) if RUBY_VERSION < '2.0.0'
s.add_development_dependency(%q<colored>)
s.add_development_dependency(%q<tzinfo>)
s.add_development_dependency(%q<ammeter>, ["0.2.5"])
View
44 lib/tasks/verify_rcov.rb
@@ -1,44 +0,0 @@
-require 'colored'
-
-# @private
-module RCov
-
- class VerifyTask < Rake::TaskLib
-
- attr_accessor :name
- attr_accessor :index_html
- attr_accessor :verbose
- attr_accessor :threshold
- attr_accessor :require_exact_threshold
-
- def initialize(name=:verify_rcov)
- @name = name
- @index_html = 'coverage/index.html'
- @verbose = true
- @require_exact_threshold = true
- yield self if block_given?
- raise "Threshold must be set" if @threshold.nil?
- define
- end
-
- def define
- desc "Verify that rcov coverage is at least #{threshold}%"
- task @name do
- total_coverage = 0
- File.open(index_html).each_line do |line|
- if line =~ /<tt class='coverage_total'>\s*(\d+\.\d+)%\s*<\/tt>/
- total_coverage = $1.to_f
- break
- end
- end
- output_coverage(total_coverage)
- end
- end
-
- def output_coverage(total_coverage)
- puts "Coverage: #{total_coverage}% (threshold: #{threshold}%)".green if verbose && total_coverage >= threshold
- raise "Coverage must be at least #{threshold}% but was #{total_coverage}%".red if total_coverage < threshold
- raise "Coverage has increased above the threshold of #{threshold}% to #{total_coverage}%. You should update your threshold value.".red if (total_coverage > threshold) and require_exact_threshold
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.