lita-hello 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lita/handlers/hello.rb +1 -1
- data/lita-hello.gemspec +1 -1
- data/spec/lita/handlers/hello_spec.rb +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 403cae7983449e17ba4b4edd9f171be6bf4265ae
|
4
|
+
data.tar.gz: 8a329d540aaa1100cfc484603f1a6ea25ead9e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dfdb8fc84210de9dccff30f24e69645da15e1d8dade7dc54dbf755aef539162611e472174ca98f502d515fabf8176fce5e5dfde0e94762b1dc29bcc372c1a4d
|
7
|
+
data.tar.gz: ecc30e0816f169be368044c7f3b02147a1b57cdb40fb351096dec1da4e733f8d7f81e8409c17bb58812206141330f66bb42c52dc01d09241fbde58ff07e55716
|
data/lib/lita/handlers/hello.rb
CHANGED
@@ -4,7 +4,7 @@ module Lita
|
|
4
4
|
module Handlers
|
5
5
|
class Hello < Handler
|
6
6
|
|
7
|
-
route(/(hello|hi|good morning|howdy|yo|hey)\
|
7
|
+
route(/(hello|hi|good morning|howdy|yo|hey)\sJanus/i, :say_hello)
|
8
8
|
|
9
9
|
def say_hello(response)
|
10
10
|
reply_to_name = response.user.metadata['mention_name'].nil? ?
|
data/lita-hello.gemspec
CHANGED
@@ -4,33 +4,33 @@ describe Lita::Handlers::Hello, lita_handler: true do
|
|
4
4
|
|
5
5
|
describe "#Hello" do
|
6
6
|
it {doesnt_route("some message").to(:say_hello)}
|
7
|
-
it {routes("Hi
|
8
|
-
it {routes("hello
|
9
|
-
it {routes("HOWDY
|
10
|
-
it {routes("good MORNING
|
7
|
+
it {routes("Hi Janus").to(:say_hello)}
|
8
|
+
it {routes("hello Janus").to(:say_hello)}
|
9
|
+
it {routes("HOWDY Janus").to(:say_hello)}
|
10
|
+
it {routes("good MORNING Janus").to(:say_hello)}
|
11
11
|
|
12
12
|
it "says hello to anyone who says Hello ChangeBot" do
|
13
|
-
send_message("Hello
|
13
|
+
send_message("Hello Janus")
|
14
14
|
expect(replies.last).to eq("Hello #{user.name}!")
|
15
15
|
end
|
16
16
|
|
17
17
|
it "says hello to anyone who says Hi ChangeBot" do
|
18
|
-
send_message("Hi
|
18
|
+
send_message("Hi Janus")
|
19
19
|
expect(replies.last).to eq("Hello #{user.name}!")
|
20
20
|
end
|
21
21
|
|
22
22
|
it "says hello to anyone who says Good Morning ChangeBot" do
|
23
|
-
send_message("Good Morning
|
23
|
+
send_message("Good Morning Janus")
|
24
24
|
expect(replies.last).to eq("Hello #{user.name}!")
|
25
25
|
end
|
26
26
|
|
27
27
|
it "says hello to anyone who says Howdy ChangeBot" do
|
28
|
-
send_message("Howdy
|
28
|
+
send_message("Howdy Janus")
|
29
29
|
expect(replies.last).to eq("Hello #{user.name}!")
|
30
30
|
end
|
31
31
|
|
32
32
|
it "ignores case" do
|
33
|
-
send_message("gOoD MORNING
|
33
|
+
send_message("gOoD MORNING Janus")
|
34
34
|
expect(replies.last).to eq("Hello #{user.name}!")
|
35
35
|
end
|
36
36
|
|