mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-10 10:50:11 +02:00
Use regex for asserting sed command
instead of having two checks, one for the first part of the command and one for asserting the trailing file name at the end of the command.
This commit is contained in:
parent
9d61638eb4
commit
7f36ca0f74
@ -84,8 +84,7 @@ public class MTABuildTest extends BasePipelineTest {
|
||||
def script = loadScript(pipeline)
|
||||
def mtarFilePath = script.execute()
|
||||
|
||||
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
|
||||
assert shellCalls[0].endsWith('/mta.yaml"')
|
||||
assert shellCalls[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/
|
||||
|
||||
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
|
||||
|
||||
@ -108,8 +107,7 @@ public class MTABuildTest extends BasePipelineTest {
|
||||
def script = loadScript(pipeline)
|
||||
def mtarFilePath = script.execute()
|
||||
|
||||
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
|
||||
assert shellCalls[0].endsWith('/mta.yaml"')
|
||||
assert shellCalls[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/
|
||||
|
||||
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
|
||||
|
||||
@ -134,8 +132,7 @@ public class MTABuildTest extends BasePipelineTest {
|
||||
def script = loadScript(pipeline)
|
||||
def mtarFilePath = script.execute(newDirName)
|
||||
|
||||
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
|
||||
assert shellCalls[0].endsWith('/mta.yaml"')
|
||||
assert shellCalls[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/newDir\/mta.yaml"$/
|
||||
|
||||
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
|
||||
|
||||
@ -155,8 +152,7 @@ public class MTABuildTest extends BasePipelineTest {
|
||||
def script = loadScript(pipeline)
|
||||
def mtarFilePath = script.execute()
|
||||
|
||||
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
|
||||
assert shellCalls[0].endsWith('/mta.yaml"')
|
||||
assert shellCalls[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/
|
||||
|
||||
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
|
||||
|
||||
@ -177,8 +173,7 @@ public class MTABuildTest extends BasePipelineTest {
|
||||
def script = loadScript(pipeline)
|
||||
def mtarFilePath = script.execute()
|
||||
|
||||
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
|
||||
assert shellCalls[0].endsWith('/mta.yaml"')
|
||||
assert shellCalls[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/
|
||||
|
||||
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user