-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.simplecov
34 lines (28 loc) · 989 Bytes
/
.simplecov
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
SimpleCov.command_name "buchungsstreber"
SimpleCov.root(__dir__)
if SimpleCov.respond_to? :enable_for_subprocesses
SimpleCov.enable_for_subprocesses false
end
SimpleCov.configure do
filters.clear
load_profile 'bundler_filter'
load_profile 'hidden_filter'
add_filter 'spec/support'
add_filter do |src|
!(src.filename =~ /^#{SimpleCov.root}/)
end
# Changed Files in Git Group
# @see http://fredwu.me/post/35625566267/simplecov-test-coverage-for-changed-files-only
untracked = `git ls-files --exclude-standard --others -z`
unstaged = `git diff --name-only -z`
staged = `git diff --name-only --cached -z`
changed_filenames = [untracked, unstaged, staged].map { |x| x.split("\x0") }.flatten
unless changed_filenames.empty?
add_group 'Changed' do |source_file|
changed_filenames.find { |x| source_file.filename.end_with?(x) }
end
end
add_group 'Specs', 'spec'
add_group 'Libraries', 'lib'
end
SimpleCov.start