Class: Producer::Core::Testing::MockRemote

Inherits:
Remote
  • Object
show all
Defined in:
lib/producer/core/testing/mock_remote.rb

Instance Attribute Summary

Attributes inherited from Remote

#hostname

Instance Method Summary collapse

Methods inherited from Remote

#cleanup, #config, #environment, #fs, #initialize, #user_name

Constructor Details

This class inherits a constructor from Producer::Core::Remote

Instance Method Details

#execute(command, output = '', error_output = '') ⇒ Object



9
10
11
12
13
14
# File 'lib/producer/core/testing/mock_remote.rb', line 9

def execute command, output = '', error_output = ''
  program, *args = command.gsub(/\d?>.*/, '').split
  program_output = command =~ />&2\z/ ? error_output : output
  send "handle_program_#{program}", args, program_output
  output
end

#sessionObject



5
6
7
# File 'lib/producer/core/testing/mock_remote.rb', line 5

def session
  fail RuntimeError, 'no session for mock remote!'
end