Class: Stretchr::TestTransporter
- Inherits:
-
Object
- Object
- Stretchr::TestTransporter
- Defined in:
- lib/stretchr/transporters/test_transporter.rb
Instance Attribute Summary collapse
-
#requests ⇒ Object
Returns the value of attribute requests.
-
#responses ⇒ Object
Returns the value of attribute responses.
Instance Method Summary collapse
-
#initialize ⇒ TestTransporter
constructor
A new instance of TestTransporter.
- #make_request(request) ⇒ Object
Constructor Details
#initialize ⇒ TestTransporter
Returns a new instance of TestTransporter.
4 5 6 7 |
# File 'lib/stretchr/transporters/test_transporter.rb', line 4 def initialize self.requests = [] self.responses = [] end |
Instance Attribute Details
#requests ⇒ Object
Returns the value of attribute requests.
3 4 5 |
# File 'lib/stretchr/transporters/test_transporter.rb', line 3 def requests @requests end |
#responses ⇒ Object
Returns the value of attribute responses.
3 4 5 |
# File 'lib/stretchr/transporters/test_transporter.rb', line 3 def responses @responses end |
Instance Method Details
#make_request(request) ⇒ Object
9 10 11 12 |
# File 'lib/stretchr/transporters/test_transporter.rb', line 9 def make_request(request) requests << request responses.shift end |