Commits

Michael Granger committed 3bb236b

Add coverage task.

  • Participants
  • Parent commits cd25aa9

Comments (0)

Files changed (3)

 hoe-deveiate -v0.1.1
 linkparser -v1.1.3
-#wordnet
+simplecov -v0.6.4
+wordnet -v1.0.0
 end
 
 ENV['VERSION'] ||= hoespec.spec.version.to_s
- 
+
 task 'hg:precheckin' => [ :check_history, :check_manifest, :spec ]
- 
+
+desc "Build a coverage report"
+task :coverage do
+	ENV["COVERAGE"] = 'yes'
+	Rake::Task[:spec].invoke
+end

File spec/lib/helpers.rb

 	$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
 }
 
+# SimpleCov test coverage reporting; enable this using the :coverage rake task
+if ENV['COVERAGE']
+	$stderr.puts "\n\n>>> Enabling coverage report.\n\n"
+	require 'simplecov'
+	SimpleCov.start do
+		add_filter 'spec'
+		add_group "Needing tests" do |file|
+			file.covered_percent < 90
+		end
+	end
+end
+
 require 'linguistics'
 
 require 'rspec'