module FakePOpen

Attributes

action[RW]
commands[RW]
error[RW]
input[RW]
output[RW]

Public Instance Methods

popen4(*command) click to toggle source
# File lib/ssh_test.rb, line 30
def popen4 *command
  @commands << command

  @input = StringIO.new
  out    = StringIO.new @output.shift.to_s
  err    = StringIO.new @error.shift.to_s

  raise if block_given?

  status = self.action ? self.action[command.join(' ')] : 0
  Process.expected Status.new(status)

  return 42, @input, out, err
end
select(reads, writes, errs, timeout) click to toggle source
# File lib/ssh_test.rb, line 45
def select reads, writes, errs, timeout
  [reads, writes, errs]
end