Class: Terminalwire::Adapter::Test
- Inherits:
-
Object
- Object
- Terminalwire::Adapter::Test
- Defined in:
- lib/terminalwire/adapter.rb
Overview
This is a test adapter that can be used for testing purposes.
Instance Attribute Summary collapse
-
#responses ⇒ Object
readonly
Returns the value of attribute responses.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(responses = []) ⇒ Test
constructor
A new instance of Test.
- #response ⇒ Object
- #write(**data) ⇒ Object
Constructor Details
#initialize(responses = []) ⇒ Test
Returns a new instance of Test.
38 39 40 |
# File 'lib/terminalwire/adapter.rb', line 38 def initialize(responses = []) @responses = responses end |
Instance Attribute Details
#responses ⇒ Object (readonly)
Returns the value of attribute responses.
36 37 38 |
# File 'lib/terminalwire/adapter.rb', line 36 def responses @responses end |
Instance Method Details
#close ⇒ Object
50 51 |
# File 'lib/terminalwire/adapter.rb', line 50 def close end |
#response ⇒ Object
46 47 48 |
# File 'lib/terminalwire/adapter.rb', line 46 def response @responses.pop end |
#write(**data) ⇒ Object
42 43 44 |
# File 'lib/terminalwire/adapter.rb', line 42 def write(**data) @responses << data end |