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 CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -33,7 +33,7 @@ grammar Sentence
33
33
  end
34
34
 
35
35
  rule word
36
- [a-zA-Z0-9]+ {
36
+ [a-zA-Z0-9']+ {
37
37
  def to_s(env = {})
38
38
  text_value
39
39
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{roflbot}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeremy Stephens"]
@@ -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(100).with do |message|
25
+ @buddy.expects(:send_im).times(20).with do |message|
26
26
  message =~ /^Hey (dude|guy), (sup\?|I love you.)$/
27
27
  end
28
- 100.times { |_| receive_im("hey") }
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jeremy Stephens