Skip to content

Commit 236db52

Browse files
committed
Add simplecov for code coverage
Conflicts: Gemfile.lock
1 parent 85dd212 commit 236db52

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
.yardoc
77
# Mac OS X files
88
.DS_Store
9+
# simplecov coverage data
10+
coverage
911
data/meterpreter/ext_server_pivot.dll
1012
data/meterpreter/ext_server_pivot.x64.dll
1113
doc

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ end
2424
group :test do
2525
# testing framework
2626
gem 'rspec'
27+
# code coverage for tests
28+
# any version newer than 0.5.4 gives an Encoding error when trying to read the source files.
29+
gem 'simplecov', '0.5.4', :require => false
2730
end

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ GEM
4545
rspec-expectations (2.11.3)
4646
diff-lcs (~> 1.1.3)
4747
rspec-mocks (2.11.3)
48+
simplecov (0.5.4)
49+
multi_json (~> 1.0.3)
50+
simplecov-html (~> 0.5.3)
51+
simplecov-html (0.5.3)
4852
slop (3.3.3)
4953
tzinfo (0.3.33)
5054
yard (0.8.2.1)
@@ -60,4 +64,5 @@ DEPENDENCIES
6064
rake
6165
redcarpet
6266
rspec
67+
simplecov (= 0.5.4)
6368
yard

spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
lib_pathname = root_pathname.join('lib')
99
$LOAD_PATH.unshift(lib_pathname.to_s)
1010

11+
# must be first require and started before any other requires so that it can measure coverage of all following required
12+
# code. It is after the rubygems and bundler only because Bundler.setup supplies the LOAD_PATH to simplecov.
13+
require 'simplecov'
14+
SimpleCov.start
15+
1116
require 'rspec/core'
1217

1318
# Requires supporting ruby files with custom matchers and macros, etc,

0 commit comments

Comments
 (0)