Skip to content
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

Merged

Conversation

nre-ableton
Copy link
Contributor

This PR provides a solution to the problems discussed in #306, by allowing users
to register filenames with a desired result for the mock.

@nre-ableton nre-ableton mentioned this pull request Oct 16, 2020
Copy link
Contributor

@stchar stchar left a 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.
@nre-ableton
Copy link
Contributor Author

@stchar Good point! Fixed as of 4279125.

@nre-ableton
Copy link
Contributor Author

re-ping @stchar -- are you ok with the PR now that documentation has been updated?

@nre-ableton nre-ableton merged commit 753c0f7 into jenkinsci:master Oct 29, 2020
@nre-ableton nre-ableton deleted the nre/master/add-fileexists-mock branch October 29, 2020 10:31
@@ -206,6 +206,7 @@ node {
```groovy
@Test
void exampleReadFileTest() {
helper.addFileExistsMock('fileExists', true)
Copy link
Member

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)?

Copy link
Contributor Author

@nre-ableton nre-ableton Mar 10, 2021

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

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants