diff options
| author | realtradam <[email protected]> | 2021-05-27 05:29:50 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2021-05-27 05:29:50 -0400 |
| commit | ecbf3f77aefb9045197e6aec89369494f878dffb (patch) | |
| tree | 2ab1ce542a572a71980078adbb374866cb6bd819 /tests/_test_helper.rb | |
| parent | 58470d70add715bd4ea4fd75c14eb56b9e649c41 (diff) | |
| download | FelECS-ecbf3f77aefb9045197e6aec89369494f878dffb.tar.gz FelECS-ecbf3f77aefb9045197e6aec89369494f878dffb.zip | |
set up to write unit tests
Diffstat (limited to 'tests/_test_helper.rb')
| -rw-r--r-- | tests/_test_helper.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/_test_helper.rb b/tests/_test_helper.rb new file mode 100644 index 0000000..25975f4 --- /dev/null +++ b/tests/_test_helper.rb @@ -0,0 +1,28 @@ +require 'simplecov' +require 'simplecov_small_badge' + +# SimpleCovSmallBadge fix +SimpleCovSmallBadge::Formatter.class_eval do + private + def state(covered_percent) + if SimpleCov.minimum_coverage[:line]&.positive? + if covered_percent >= SimpleCov.minimum_coverage[:line] + 'good' + else + 'bad' + end + else + 'unknown' + end + end +end + +SimpleCov.start do + SimpleCov.add_filter 'tests' + SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::HTMLFormatter, + SimpleCovSmallBadge::Formatter + ]) +end + +require 'minitest/autorun' |
