Implement Testing::MockRemote#execute

This commit is contained in:
Thibault Jouan
2014-03-04 05:40:13 +00:00
parent b576604498
commit 85e3bf2eac
2 changed files with 41 additions and 0 deletions

View File

@@ -5,6 +5,20 @@ module Producer
def session
raise 'no session for mock remote!'
end
def execute(command)
tokens = command.split
program = tokens.shift
case program
when 'echo'
tokens.join ' '
when 'true'
''
when 'false'
raise RemoteCommandExecutionError
end
end
end
end
end