-
Notifications
You must be signed in to change notification settings - Fork 396
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
Add fileExists mock with helper methods #312
Add fileExists mock with helper methods #312
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, could you please update the documentation
This mock is similar to the readFile mock in that mock files can be added to the PipelineTestHelper. If no filename is registered with the helper, then the mock returns false by default.
e7b939d
to
4279125
Compare
re-ping @stchar -- are you ok with the PR now that documentation has been updated? |
@@ -206,6 +206,7 @@ node { | |||
```groovy | |||
@Test | |||
void exampleReadFileTest() { | |||
helper.addFileExistsMock('fileExists', true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be
helper.addFileExistsMock('output', true)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, I think this is a typo. See #350.
@@ -1,5 +1,7 @@ | |||
package com.lesfurets.jenkins.unit | |||
|
|||
import com.sun.org.apache.xpath.internal.operations.Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @nre-ableton !
Why this unused import com.sun.org.apache.xpath.internal.operations.Bool here?
This PR provides a solution to the problems discussed in #306, by allowing users
to register filenames with a desired result for the mock.