lita-onewheel-duckduckgo 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8a06a1cd22705cbc9d94d21eef284bff472ca25
|
4
|
+
data.tar.gz: 2011ae1201bfb165f9b8b571495cce9787998833
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e2b122d6fb0549029b8f3fd68967730cf3a7fee5e322873c95a96f606499b129c462a61166a8eefc3a04f6f9de03bba5d269bfb8706b8948b0ee30b10eb62bc
|
7
|
+
data.tar.gz: 8ea1a94f499e367ebefd0df7aa012f2a1423844505b091cc5ab59e7e20b87eff09f368cb8c07dbd06a9ada62ce26737b68aad74d623a800f76634a4338169ec4
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-duckduckgo'
|
3
|
-
spec.version = '0.0.
|
3
|
+
spec.version = '0.0.2'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = 'Lita handler for Duck Duck Go\'s answers engine.'
|
@@ -6,19 +6,28 @@ describe Lita::Handlers::OnewheelDuckDuckGo, lita_handler: true do
|
|
6
6
|
before(:each) do
|
7
7
|
end
|
8
8
|
|
9
|
+
def mock(file)
|
10
|
+
mock_result_json = File.open("spec/fixtures/#{file}.json").read
|
11
|
+
allow(RestClient).to receive(:get).and_return( mock_result_json)
|
12
|
+
end
|
13
|
+
|
9
14
|
it { is_expected.to route_command('duck something') }
|
10
15
|
|
11
16
|
it 'does neat ducky things' do
|
12
|
-
|
13
|
-
allow(RestClient).to receive(:get).and_return(JSON.parse mock_result_json)
|
17
|
+
mock('mock_result')
|
14
18
|
send_command 'duck yo'
|
15
19
|
expect(replies.last).to include('DuckDuckGo Result: DuckDuckGo is an Internet search engine that emphasizes')
|
16
20
|
end
|
17
21
|
|
18
22
|
it 'uses the url unless the abstract exists' do
|
19
|
-
|
20
|
-
allow(RestClient).to receive(:get).and_return(JSON.parse mock_result_json)
|
23
|
+
mock('mock_no_abstract')
|
21
24
|
send_command 'duck yo'
|
22
25
|
expect(replies.last).to include('DuckDuckGo Result: https://en.wikipedia.org/wiki/Duck_(disambiguation)')
|
23
26
|
end
|
27
|
+
|
28
|
+
it 'checks for go' do
|
29
|
+
mock('mock_go')
|
30
|
+
send_command 'duck go'
|
31
|
+
expect(replies.last).to include('DuckDuckGo Result: https://en.wikipedia.org/wiki/Go')
|
32
|
+
end
|
24
33
|
end
|