@@ -15,32 +15,32 @@ setup() {
1515 exit_status=$?
1616 } || true
1717 [[ $exit_status -eq 1 ]]
18- [[ $( echo " ${output} " | tail -n 1) = " The workflow is triggered by a user neither as a code owner nor a maintainer of the image img" ]]
18+ [[ $( echo " ${output} " | tail -n 1) =~ " The workflow is triggered by a user neither as a code owner nor a maintainer of the image img" ]]
1919}
2020
2121@test " allows code owner" {
2222 output=$( ${BATS_TEST_DIRNAME} /validate-actor.sh " code-owner" " true" $workdir " img" 2>&1 )
23- [[ $( echo " ${output} " | tail -n 1) = " The workflow is triggered by code-owner as the code owner" ]]
23+ [[ $( echo " ${output} " | tail -n 1) =~ " The workflow is triggered by code-owner as the code owner" ]]
2424}
2525
2626@test " allows image maintainer" {
2727 output=$( ${BATS_TEST_DIRNAME} /validate-actor.sh " maintainer" " true" $workdir " img" )
28- [[ $( echo " ${output} " | tail -n 1) = " The workflow is triggered by maintainer as a maintainer of the image img" ]]
28+ [[ $( echo " ${output} " | tail -n 1) =~ " The workflow is triggered by maintainer as a maintainer of the image img" ]]
2929}
3030
3131@test " allows non-code-owner-non-maintainer user" {
3232 output=$( ${BATS_TEST_DIRNAME} /validate-actor.sh " random" " false" $workdir " img" )
33- [[ $( echo " ${output} " | tail -n 1) = " The workflow is not restricted to non-code-owner or non-maintainer users" ]]
33+ [[ $( echo " ${output} " | tail -n 1) =~ " The workflow is not restricted to non-code-owner or non-maintainer users" ]]
3434}
3535
3636@test " user as both code-owner and maintainer is triggered as code owner" {
3737 echo -n " @maintainer" >> $workdir /CODEOWNERS
3838 output=$( ${BATS_TEST_DIRNAME} /validate-actor.sh " maintainer" " true" $workdir " img" )
39- [[ $( echo " ${output} " | tail -n 1) = " The workflow is triggered by maintainer as the code owner" ]]
39+ [[ $( echo " ${output} " | tail -n 1) =~ " The workflow is triggered by maintainer as the code owner" ]]
4040}
4141
4242@test " teams are expanded to team members" {
4343 echo -n " @canonical/rocks" >> $workdir /CODEOWNERS
4444 output=$( ${BATS_TEST_DIRNAME} /validate-actor.sh " ROCKsBot" " true" $workdir " img" )
45- [[ $( echo " ${output} " | tail -n 1) = " The workflow is triggered by ROCKsBot as the code owner" ]]
45+ [[ $( echo " ${output} " | tail -n 1) =~ " The workflow is triggered by ROCKsBot as the code owner" ]]
4646}
0 commit comments