From 5c3307d71bfd2d04065210785633e7d9505f94ba Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Wed, 26 Jun 2019 17:05:39 +0200 Subject: [PATCH] Add hasSnippet --- test/groovy/util/CommandLineMatcher.groovy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/groovy/util/CommandLineMatcher.groovy b/test/groovy/util/CommandLineMatcher.groovy index 5a778b0b7..734a5acc0 100644 --- a/test/groovy/util/CommandLineMatcher.groovy +++ b/test/groovy/util/CommandLineMatcher.groovy @@ -31,6 +31,11 @@ class CommandLineMatcher extends BaseMatcher { return this } + CommandLineMatcher hasSnippet(String snippet) { + this.args.add(snippet) + return this + } + CommandLineMatcher hasArgument(String arg) { this.args.add(arg) return this @@ -58,7 +63,7 @@ class CommandLineMatcher extends BaseMatcher { for (String arg : args) { if (!cmd.matches(/.*[\s]*${arg}[\s]*.*/)) { - hint = "A command line having argument '${arg}'." + hint = "A command line having argument/snippet '${arg}'." matches = false } }