You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.914 s <<< FAILURE! - in lintTest
[ERROR] lintTest.test 01: successfully invoke Time elapsed: 0.339 s <<< ERROR!
groovy.lang.MissingMethodException:
No signature of method: org.xy.carbon.detect.script() is applicable for argument types: (org.xy.carbon.detect$_changedFiles_closure1) values: [org.xy.carbon.detect$_changedFiles_closure1@6917bb4]
Possible solutions: print(java.lang.Object), split(groovy.lang.Closure), print(java.lang.Object), print(java.io.PrintWriter), wait(), grep()
at org.xy.carbon.detect.changedFiles(detect.groovy:9)
at org.xy.carbon.lint.lintYamlFiles_closure1(lint.groovy:8)
at org.xy.carbon.lint.lintYamlFiles_closure1(lint.groovy)
at com.homeaway.devtools.jenkins.testing.JenkinsPipelineSpecification.addPipelineMocksToObjects_closure1$_closure14(JenkinsPipelineSpecification.groovy:682)
at org.xy.carbon.lint.lintYamlFiles(lint.groovy:5)
at lintTest.test 01: successfully invoke (lintTest.groovy:38)
Is it possible to mock interactions with methods in external libraries?
The text was updated successfully, but these errors were encountered:
It's unfortunate, but the Groovy syntactic sugar of ".call() is implicitly the same as just attaching those parentheses to an object" doesn't work every time with the shenanigans we had to go through to get implicit, automatic mocking working in jenkins-spock.
code under test: lint.groovy
I'm trying to mock execution of detect.changedFiles() like this:
executions fail with:
Is it possible to mock interactions with methods in external libraries?
The text was updated successfully, but these errors were encountered: