Class: Telepost::Fake

Inherits:
Object
  • Object
show all
Defined in:
lib/telepost.rb

Overview

Note:

Use this class for testing purposes

Fake implementation for testing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFake

Returns a new instance of Fake.



30
31
32
# File 'lib/telepost.rb', line 30

def initialize
  @sent = []
end

Instance Attribute Details

#sentObject (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

#runObject



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