Skip to content

Commit ff9fc02

Browse files
committed
Merge remote-tracking branch 'rapid7/feature/simplecov-groups' into rapid7
2 parents e4e9a94 + 3c2c808 commit ff9fc02

File tree

2 files changed

+58
-6
lines changed

2 files changed

+58
-6
lines changed

.simplecov

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# RM_INFO is set when using Rubymine. In Rubymine, starting SimpleCov is
2+
# controlled by running with coverage, so don't explicitly start coverage (and
3+
# therefore generate a report) when in Rubymine. This _will_ generate a report
4+
# whenever `rake spec` is run.
5+
unless ENV['RM_INFO']
6+
SimpleCov.start
7+
end
8+
9+
SimpleCov.configure do
10+
# ignore this file
11+
add_filter '.simplecov'
12+
13+
#
14+
# Changed Files in Git Group
15+
# @see http://fredwu.me/post/35625566267/simplecov-test-coverage-for-changed-files-only
16+
#
17+
18+
untracked = `git ls-files --exclude-standard --others`
19+
unstaged = `git diff --name-only`
20+
staged = `git diff --name-only --cached`
21+
all = untracked + unstaged + staged
22+
changed_filenames = all.split("\n")
23+
24+
add_group 'Changed' do |source_file|
25+
changed_filenames.detect { |changed_filename|
26+
source_file.filename.end_with?(changed_filename)
27+
}
28+
end
29+
30+
#
31+
# Framework (msf) related groups
32+
#
33+
34+
add_group 'Metasploit Framework', 'lib/msf'
35+
add_group 'Metasploit Framework (Base)', 'lib/msf/base'
36+
add_group 'Metasploit Framework (Core)', 'lib/msf/core'
37+
38+
#
39+
# Other library groups
40+
#
41+
42+
add_group 'Fastlib', 'lib/fastlib'
43+
add_group 'Metasm', 'lib/metasm'
44+
add_group 'PacketFu', 'lib/packetfu'
45+
add_group 'Rex', 'lib/rex'
46+
add_group 'RKelly', 'lib/rkelly'
47+
add_group 'Ruby Mysql', 'lib/rbmysql'
48+
add_group 'Ruby Postgres', 'lib/postgres'
49+
add_group 'SNMP', 'lib/snmp'
50+
add_group 'Zip', 'lib/zip'
51+
52+
#
53+
# Specs are reported on to ensure that all examples are being run and all
54+
# lets, befores, afters, etc are being used.
55+
#
56+
57+
add_group 'Specs', 'spec'
58+
end

spec/spec_helper.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
# must be first require and started before any other requires so that it can measure coverage of all following required
1212
# code. It is after the rubygems and bundler only because Bundler.setup supplies the LOAD_PATH to simplecov.
1313
require 'simplecov'
14-
# Ensure the coverage directory is always the same no matter where the individual spec is in the hierarchy when using
15-
# Rubymine to run one spec.
16-
#
17-
# @see https://github.com/colszowka/simplecov/issues/95
18-
SimpleCov.root(root_pathname)
19-
SimpleCov.start
2014

2115
require 'rspec/core'
2216

0 commit comments

Comments
 (0)