roflbot 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/roflbot/sentence.tt +1 -1
- data/roflbot.gemspec +1 -1
- data/test/roflbot/test_sentence_bot.rb +12 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/lib/roflbot/sentence.tt
CHANGED
data/roflbot.gemspec
CHANGED
@@ -22,10 +22,20 @@ module Roflbot
|
|
22
22
|
def test_responses
|
23
23
|
bot = SentenceBot.new(@options)
|
24
24
|
|
25
|
-
@buddy.expects(:send_im).times(
|
25
|
+
@buddy.expects(:send_im).times(20).with do |message|
|
26
26
|
message =~ /^Hey (dude|guy), (sup\?|I love you.)$/
|
27
27
|
end
|
28
|
-
|
28
|
+
20.times { |_| receive_im("hey") }
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_parses_quotes
|
32
|
+
@options["sentences"] = ["You're awesome (noun), (ending)"]
|
33
|
+
bot = SentenceBot.new(@options)
|
34
|
+
|
35
|
+
@buddy.expects(:send_im).times(20).with do |message|
|
36
|
+
message =~ /^You're awesome (dude|guy), (sup\?|I love you.)$/
|
37
|
+
end
|
38
|
+
20.times { |_| receive_im("hey") }
|
29
39
|
end
|
30
40
|
end
|
31
41
|
end
|