fudge
fudge copied to clipboard
Coverage testing issue when you have a multiple of 10 rspec tests.
If you have rspec tests which total a multiple of 10, then the coverage checker will not work if the tests are passing:
be fudge build
Running build default
Running task rspec {:coverage=>100}
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
......................................................................
Finished in 0.06867 seconds
70 examples, 0 failures
Randomized with seed 4963
Coverage report generated for RSpec to /Volumes/Macintosh HD 2/development/my_repo/coverage. 384 / 700 LOC (54.86%) covered.
Skipping callbacks...
Build SUCCEEDED!
The reason being that the regex to check the coverage, matches on 0 examples 0 failures which of course 70 examples 0 failures also matches!
Issue seems to be with this line: https://github.com/Sage/fudge/blob/master/lib/fudge/tasks/rspec.rb#L11
# Preconditions to check for coverage, that if not met make the test pass
# for example, if no tests exist, no need to fail
def pre_conditions_regex
/(0 examples, 0 failures)/ # no tests exist
end
I believe this can be fixed by adjusting the regex as follows:
def pre_conditions_regex
/^(0 examples, 0 failures)/ # no tests exist
end