mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
Merge pull request #280 from marcusholl/pr/libResourceAndReadYamlCloserToReality
Be more precise with libraryResource and read yaml in prepareDefaultV…
This commit is contained in:
commit
1802d0c15a
@ -30,16 +30,14 @@ public class PrepareDefaultValuesTest extends BasePiperTest {
|
||||
@Before
|
||||
public void setup() {
|
||||
|
||||
helper.registerAllowedMethod("libraryResource", [String], { fileName-> return fileName })
|
||||
helper.registerAllowedMethod("readYaml", [Map], { m ->
|
||||
switch(m.text) {
|
||||
case 'default_pipeline_environment.yml': return [default: 'config']
|
||||
case 'custom.yml': return [custom: 'myConfig']
|
||||
helper.registerAllowedMethod("libraryResource", [String], { fileName ->
|
||||
switch(fileName) {
|
||||
case 'default_pipeline_environment.yml': return "default: 'config'"
|
||||
case 'custom.yml': return "custom: 'myConfig'"
|
||||
case 'not_found': throw new hudson.AbortException('No such library resource not_found could be found')
|
||||
default: return [the:'end']
|
||||
default: return "the:'end'"
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user