Class: Zerg::Support::EventMachine::SendMock

Inherits:
Object
  • Object
show all
Defined in:
lib/zerg_support/event_machine/connection_mocks.rb

Overview

Mocks the sending end of an EventMachine connection. The sent data is concatenated in a string available by calling #string.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSendMock

Returns a new instance of SendMock.



9
10
11
# File 'lib/zerg_support/event_machine/connection_mocks.rb', line 9

def initialize
  @string = ''
end

Instance Attribute Details

#stringObject (readonly)

Returns the value of attribute string.



7
8
9
# File 'lib/zerg_support/event_machine/connection_mocks.rb', line 7

def string
  @string
end

Instance Method Details

#send_data(data) ⇒ Object



13
14
15
# File 'lib/zerg_support/event_machine/connection_mocks.rb', line 13

def send_data(data)
  @string << data
end