Class: TestR::Client::Transceiver

Inherits:
Receiver
  • Object
show all
Defined in:
lib/testr/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(*popen_args) ⇒ Transceiver



19
20
21
22
23
# File 'lib/testr/client.rb', line 19

def initialize *popen_args
  @io_write_lock = Mutex.new
  popen_args[1] = 'w+'
  super
end

Instance Method Details

#quitObject



32
33
34
35
# File 'lib/testr/client.rb', line 32

def quit
  send [:quit]
  super
end

#send(command) ⇒ Object



25
26
27
28
29
30
# File 'lib/testr/client.rb', line 25

def send command
  @io_write_lock.synchronize do
    warn "#{caller[2]} SEND #{command.inspect}" if $DEBUG
    @io.puts JSON.dump(command)
  end
end