From c8ab4aa466c7c3000164ed2bf80fd43b3e9128fc Mon Sep 17 00:00:00 2001 From: Szczepan Faber Date: Sun, 6 Dec 2020 23:32:21 -0600 Subject: [PATCH] Fixed the test Made it run reliably on different types of OS --- .../org/shipkit/auto/version/ProcessRunnerTest.groovy | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/groovy/org/shipkit/auto/version/ProcessRunnerTest.groovy b/src/test/groovy/org/shipkit/auto/version/ProcessRunnerTest.groovy index 703cf87..bdaeaf1 100644 --- a/src/test/groovy/org/shipkit/auto/version/ProcessRunnerTest.groovy +++ b/src/test/groovy/org/shipkit/auto/version/ProcessRunnerTest.groovy @@ -1,10 +1,8 @@ package org.shipkit.auto.version - import spock.lang.IgnoreIf -//ignore the test when there is no 'ls' utility -@IgnoreIf({ !commandAvailable("ls") }) + class ProcessRunnerTest extends TmpFolderSpecification { def "runs processes and returns output"() { @@ -35,9 +33,10 @@ class ProcessRunnerTest extends TmpFolderSpecification { then: def e = thrown(ShipkitAutoVersionException) - e.message.startsWith """[shipkit-auto-version] Problems executing command (exit code: 1): ls --kaboom + e.message.startsWith "[shipkit-auto-version] Problems executing command (exit code: " + e.message.contains """ls --kaboom Output: -ls: illegal option""" +ls: """ } static boolean commandAvailable(String command) {