Mercurial > repos > other > Puppet
annotate modules/translate/spec/spec_helper_local.rb @ 245:b0f8b88fea5c
Add "translate" module used by MySQL module
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 21 Dec 2019 14:12:10 -0500 |
parents | |
children |
rev | line source |
---|---|
245
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 if ENV['COVERAGE'] == 'yes' |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 require 'simplecov' |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 require 'simplecov-console' |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 require 'codecov' |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 SimpleCov.formatters = [ |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 SimpleCov::Formatter::HTMLFormatter, |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 SimpleCov::Formatter::Console, |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 SimpleCov::Formatter::Codecov, |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 ] |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 SimpleCov.start do |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 track_files 'lib/**/*.rb' |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 add_filter '/spec' |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 # do not track vendored files |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 add_filter '/vendor' |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 add_filter '/.vendor' |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 # do not track gitignored files |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 # this adds about 4 seconds to the coverage check |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 # this could definitely be optimized |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 add_filter do |f| |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 # system returns true if exit status is 0, which with git-check-ignore means file is ignored |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 system("git check-ignore --quiet #{f.filename}") |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 end |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 end |
b0f8b88fea5c
Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 end |