Class: Twi::Mock::Phone
Instance Attribute Summary
Attributes inherited from Phone
Instance Method Summary collapse
-
#create ⇒ Object
Answers whatever the suite arranged, an error before anything else and once only, as the message and the call mocks do: an error left behind would refuse every later number.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Twi::Resource
Instance Method Details
#create ⇒ Object
Answers whatever the suite arranged, an error before anything else and once only, as the message and the call mocks do: an error left behind would refuse every later number.
5 6 7 8 9 10 11 12 13 |
# File 'lib/twi/mock/phone.rb', line 5 def create if error = Twi.mock.phone_error Twi.mock.phone_error = nil raise Error, error elsif Twi.mock.phone @id = Twi.mock.phone[:id] @number = Twi.mock.phone[:number] end end |