-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(maint) Add a spec case for the provision::abs task #186
Conversation
I have some rubocop issues to sort out. Ok, those are fixed. |
e4ee99b
to
03cedb8
Compare
03cedb8
to
4a9ad02
Compare
Codecov Report
@@ Coverage Diff @@
## main #186 +/- ##
=======================================
Coverage ? 76.97%
=======================================
Files ? 2
Lines ? 139
Branches ? 0
=======================================
Hits ? 107
Misses ? 32
Partials ? 0 Continue to review full report at Codecov.
|
The abs.rb is refactored into a class that is executed only if the task file is the executing program. This allows the spec to load the task and manipulate the class while mocking externals. The webmock gem is used to provide HTTP::Net mocking. The spec is not exhaustive, but hopefully covers enough to validate that the refactor didn't break the task, and that the bug I added in puppetlabs#182 is patched. It could be expanded, and could serve as a template for adding specs for other tasks in the module. It does look to expose an edge case bug of calling the provision task with an inventory directory specified that contains a pre-existing inventory file.
24f910e
to
cd72bb6
Compare
The abs.rb is refactored into a class that is executed only if the task
file is the executing program. This allows the spec to load the task and
manipulate the class while mocking externals. The webmock gem is used to
provide HTTP::Net mocking.
The spec is not exhaustive, but hopefully covers enough to validate that
the refactor didn't break the task, and that the bug I added in #182 is
patched.
It could be expanded, and could serve as a template for adding specs
for other tasks in the module.
It does look to expose an edge case bug of calling the provision task
with an inventory directory specified that contains a pre-existing
inventory file.