quattor / maven-tools

Maven-based Build Tools
www.quattor.org
Apache License 2.0
3 stars 12 forks source link

Test::Quattor: mock CAF::Path link-related functions #142

Closed jouvin closed 7 years ago

jouvin commented 7 years ago

Requires https://github.com/quattor/CAF/pull/225 to pass the tests successfully.

Probably some additional unit tests would be useful but main features of link-related functions are covered.

Fixes #141

stdweird commented 7 years ago

retest this please

stdweird commented 7 years ago

@jouvin jenkins test fails

#   Failed test 'File /some/where/files/target3 already exists and option 'force' not specified'
#   at /data/jenkins/workspace/maven-tools-pr-builder/build-scripts/src/main/perl/Test/Quattor.pm line 645.
stdweird commented 7 years ago

@jouvin wrt failing test, if you want to check that a unittest failure is triggered by the ok(0, ...) code, you need to mock ok itself. see eg https://github.com/quattor/maven-tools/blob/master/build-scripts/src/test/perl/quattor.t#L41 you can mock it before the test or method call; and unmock it again after.

jouvin commented 7 years ago

I'll check! It was working for me as far as I remember...

stdweird commented 7 years ago

big thanks!