Implement `` condition keyword (shell cmd status)
This commit is contained in:
1 parent
a2ca62e7f8
commit
7c6ac4c9d8
6 files changed
+85
No files matched your search
@@ -13,6 +13,7 @@ module Producer
|
||||
end
|
||||
end
|
||||
|
||||
define_test :`, Tests::ShellCommandStatus
|
||||
define_test :file_contains, Tests::FileContains
|
||||
define_test :has_env, Tests::HasEnv
|
||||
define_test :has_executable, Tests::HasExecutable
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
module Producer
|
||||
module Core
|
||||
module Tests
|
||||
class ShellCommandStatus < Test
|
||||
def verify
|
||||
remote.execute(command)
|
||||
true
|
||||
rescue RemoteCommandExecutionError
|
||||
false
|
||||
end
|
||||
|
||||
def command
|
||||
arguments.first
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user