Implement `has_executable' condition keyword

This commit is contained in:
Thibault Jouan
2014-03-05 07:19:15 +00:00
parent aa3694b58c
commit eeab386216
6 changed files with 86 additions and 5 deletions

View File

@@ -13,10 +13,11 @@ module Producer
end
end
define_test :file_contains, Tests::FileContains
define_test :has_env, Tests::HasEnv
define_test :has_dir, Tests::HasDir
define_test :has_file, Tests::HasFile
define_test :file_contains, Tests::FileContains
define_test :has_env, Tests::HasEnv
define_test :has_executable, Tests::HasExecutable
define_test :has_dir, Tests::HasDir
define_test :has_file, Tests::HasFile
attr_reader :block, :env, :tests

View File

@@ -0,0 +1,14 @@
module Producer
module Core
module Tests
class HasExecutable < Test
def verify
remote.execute("type #{arguments.first}")
true
rescue RemoteCommandExecutionError
false
end
end
end
end
end