Browse files

Add simplecov for code coverage

Conflicts:
	Gemfile.lock
  • Loading branch information...
1 parent 85dd212 commit 236db52d3d8ef2747ef767cb6fea8ea03f67a54c @limhoff-r7 limhoff-r7 committed Nov 6, 2012
Showing with 15 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +3 −0 Gemfile
  3. +5 −0 Gemfile.lock
  4. +5 −0 spec/spec_helper.rb
View
2 .gitignore
@@ -6,6 +6,8 @@
.yardoc
# Mac OS X files
.DS_Store
+# simplecov coverage data
+coverage
data/meterpreter/ext_server_pivot.dll
data/meterpreter/ext_server_pivot.x64.dll
doc
View
3 Gemfile
@@ -24,4 +24,7 @@ end
group :test do
# testing framework
gem 'rspec'
+ # code coverage for tests
+ # any version newer than 0.5.4 gives an Encoding error when trying to read the source files.
+ gem 'simplecov', '0.5.4', :require => false
end
View
5 Gemfile.lock
@@ -45,6 +45,10 @@ GEM
rspec-expectations (2.11.3)
diff-lcs (~> 1.1.3)
rspec-mocks (2.11.3)
+ simplecov (0.5.4)
+ multi_json (~> 1.0.3)
+ simplecov-html (~> 0.5.3)
+ simplecov-html (0.5.3)
slop (3.3.3)
tzinfo (0.3.33)
yard (0.8.2.1)
@@ -60,4 +64,5 @@ DEPENDENCIES
rake
redcarpet
rspec
+ simplecov (= 0.5.4)
yard
View
5 spec/spec_helper.rb
@@ -8,6 +8,11 @@
lib_pathname = root_pathname.join('lib')
$LOAD_PATH.unshift(lib_pathname.to_s)
+# must be first require and started before any other requires so that it can measure coverage of all following required
+# code. It is after the rubygems and bundler only because Bundler.setup supplies the LOAD_PATH to simplecov.
+require 'simplecov'
+SimpleCov.start
+
require 'rspec/core'
# Requires supporting ruby files with custom matchers and macros, etc,

0 comments on commit 236db52

Please sign in to comment.