Class: Telepost::Fake
- Inherits:
-
Object
- Object
- Telepost::Fake
- Defined in:
- lib/telepost.rb
Overview
Note:
Use this class for testing purposes
Fake implementation for testing
Instance Attribute Summary collapse
-
#sent ⇒ Object
readonly
Returns the value of attribute sent.
Instance Method Summary collapse
-
#initialize ⇒ Fake
constructor
A new instance of Fake.
- #post(chat, *lines) ⇒ Object
- #run ⇒ Object
- #spam(*lines) ⇒ Object
Constructor Details
#initialize ⇒ Fake
Returns a new instance of Fake.
30 31 32 |
# File 'lib/telepost.rb', line 30 def initialize @sent = [] end |
Instance Attribute Details
#sent ⇒ Object (readonly)
Returns the value of attribute sent.
28 29 30 |
# File 'lib/telepost.rb', line 28 def sent @sent end |
Instance Method Details
#post(chat, *lines) ⇒ Object
42 43 44 |
# File 'lib/telepost.rb', line 42 def post(chat, *lines) @sent << "#{chat}: #{lines.join(' ')}" end |
#run ⇒ Object
34 35 36 |
# File 'lib/telepost.rb', line 34 def run # Nothing to do here end |
#spam(*lines) ⇒ Object
38 39 40 |
# File 'lib/telepost.rb', line 38 def spam(*lines) post(0, lines) end |