lita-snoo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/lita-snoo.gemspec +1 -1
- data/spec/lita/handlers/snoo_spec.rb +8 -8
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d191cf075eb289d5575d0bc615e89b521efc9a2
|
4
|
+
data.tar.gz: ebb0374e6f9a9fb7474bb18d9f1f6c52702f138d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8eda2214e8ab83692691959511308c2b6a112588c99cf47a8cd4d194b157ac63e60b0c98fcb22ddecf6e365ec8b0630fc0479808881e1a22753399d36dca2d34
|
7
|
+
data.tar.gz: 41a064110f2fbe60fa68265ac64b6450a802da019fc9f3bceccedd56493db10d29f7b6aea9ac6d692e440e5bfd1dc0da1e85a43872d977fbdf6a62bf785f547c
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/lita-snoo.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-snoo"
|
3
|
-
spec.version = "0.1.
|
3
|
+
spec.version = "0.1.1"
|
4
4
|
spec.authors = ["Tristan Chong"]
|
5
5
|
spec.email = ["ong@tristaneuan.ch"]
|
6
6
|
spec.description = "A Lita handler for reddit that can detect imgur (or custom) URLs and find their original posts"
|
@@ -22,13 +22,13 @@ describe Lita::Handlers::Snoo, lita_handler: true do
|
|
22
22
|
it "returns the top reddit post for a detected imgur.com link" do
|
23
23
|
send_message "i hella miss the city yadadamean http://imgur.com/Eh3HkJ9"
|
24
24
|
expect(replies.count).to eq 1
|
25
|
-
expect(replies.first).to match(/^Looking down San Francisco's California Street towards the Bay Bridge\. - zauzau on \/r\/pics, 2014-10-
|
25
|
+
expect(replies.first).to match(/^Looking down San Francisco's California Street towards the Bay Bridge\. - zauzau on \/r\/pics, 2014-10-1\d \(\d{1,3},\d{3}\ points\) http:\/\/redd\.it\/2jl5np$/)
|
26
26
|
end
|
27
27
|
|
28
28
|
it "returns the top reddit post for a detected i.imgur.com link" do
|
29
29
|
send_message "http://i.imgur.com/Eh3HkJ9.jpg"
|
30
30
|
expect(replies.count).to eq 1
|
31
|
-
expect(replies.first).to match(/^Looking down San Francisco's California Street towards the Bay Bridge\. - zauzau on \/r\/pics, 2014-10-
|
31
|
+
expect(replies.first).to match(/^Looking down San Francisco's California Street towards the Bay Bridge\. - zauzau on \/r\/pics, 2014-10-1\d \(\d{1,3},\d{3}\ points\) http:\/\/redd\.it\/2jl5np$/)
|
32
32
|
end
|
33
33
|
|
34
34
|
it "does not return anything for a detected imgur link if it has not been submitted to reddit" do
|
@@ -50,7 +50,7 @@ describe Lita::Handlers::Snoo, lita_handler: true do
|
|
50
50
|
it "strips anything following # from URLs" do
|
51
51
|
send_message "http://i.imgur.com/Eh3HkJ9.jpg#.png"
|
52
52
|
expect(replies.count).to eq 1
|
53
|
-
expect(replies.first).to match(/^Looking down San Francisco's California Street towards the Bay Bridge\. - zauzau on \/r\/pics, 2014-10-
|
53
|
+
expect(replies.first).to match(/^Looking down San Francisco's California Street towards the Bay Bridge\. - zauzau on \/r\/pics, 2014-10-1\d \(\d{1,3},\d{3}\ points\) http:\/\/redd\.it\/2jl5np$/)
|
54
54
|
end
|
55
55
|
|
56
56
|
it "unescapes strings that have been HTML-escaped" do
|
@@ -66,7 +66,7 @@ describe Lita::Handlers::Snoo, lita_handler: true do
|
|
66
66
|
it "returns the top reddit post for a given link" do
|
67
67
|
send_command "reddit http://i.imgur.com/Eh3HkJ9.jpg"
|
68
68
|
expect(replies.count).to eq 1
|
69
|
-
expect(replies.first).to match(/^Looking down San Francisco's California Street towards the Bay Bridge\. - zauzau on \/r\/pics, 2014-10-
|
69
|
+
expect(replies.first).to match(/^Looking down San Francisco's California Street towards the Bay Bridge\. - zauzau on \/r\/pics, 2014-10-1\d \(\d{1,3},\d{3}\ points\) http:\/\/redd\.it\/2jl5np$/)
|
70
70
|
end
|
71
71
|
|
72
72
|
it "returns an appropriate message for a given link if it has not been submitted to reddit" do
|
@@ -94,7 +94,7 @@ describe Lita::Handlers::Snoo, lita_handler: true do
|
|
94
94
|
it "returns the most relevant result for a given subreddit-specific search query" do
|
95
95
|
send_command "/r/linguistics lambda calculus"
|
96
96
|
expect(replies.count).to eq 1
|
97
|
-
expect(replies.first).to match(/^Intro to lambda calculus \(for linguists!\) - leftoversalad on \/r\/linguistics, 2015-02-
|
97
|
+
expect(replies.first).to match(/^Intro to lambda calculus \(for linguists!\) - leftoversalad on \/r\/linguistics, 2015-02-1\d \(\d+ points\) http:\/\/redd\.it\/2w4ir4$/)
|
98
98
|
end
|
99
99
|
|
100
100
|
it "returns an appropriate message when no results can be found for a given subreddit-specific search query" do
|
@@ -160,13 +160,13 @@ describe Lita::Handlers::Snoo, lita_handler: true do
|
|
160
160
|
it "returns the top reddit post for a detected link on a custom domain" do
|
161
161
|
send_message "https://www.flickr.com/photos/walkingsf/4671581511 not surprised about union square, trying to maneuver through all the tourists with their phones out gives me a bad case of irritable powell syndrome"
|
162
162
|
expect(replies.count).to eq 1
|
163
|
-
expect(replies.first).to match(/^Where photos in San Francisco are taken by tourists \(red\) vs locals \(blue\) - hfutrell on \/r\/sanfrancisco, 2015-05-
|
163
|
+
expect(replies.first).to match(/^Where photos in San Francisco are taken by tourists \(red\) vs locals \(blue\) - hfutrell on \/r\/sanfrancisco, 2015-05-1\d \(\d{3} points\) http:\/\/redd\.it\/35yr3b$/)
|
164
164
|
end
|
165
165
|
|
166
166
|
it "returns the top reddit post for a detected link on a different custom domain" do
|
167
167
|
send_message "http://accent.gmu.edu/"
|
168
168
|
expect(replies.count).to eq 1
|
169
|
-
expect(replies.first).to match(/^Ever wonder what an Armenian accend sounds like\? How about a Swahili Accent\? This site has them all\. - topemo on \/r\/reddit\.com, 2006-04-
|
169
|
+
expect(replies.first).to match(/^Ever wonder what an Armenian accend sounds like\? How about a Swahili Accent\? This site has them all\. - topemo on \/r\/reddit\.com, 2006-04-0\d \(\d{2} points\) http:\/\/redd\.it\/3udn$/)
|
170
170
|
end
|
171
171
|
|
172
172
|
it "does not return anything for a detected link on a custom domain if it has not been submitted to reddit" do
|
@@ -186,7 +186,7 @@ describe Lita::Handlers::Snoo, lita_handler: true do
|
|
186
186
|
it "only returns one post when a given link is in the list of custom domains" do
|
187
187
|
send_command "snoo https://www.flickr.com/photos/walkingsf/4671581511"
|
188
188
|
expect(replies.count).to eq 1
|
189
|
-
expect(replies.first).to match(/^Where photos in San Francisco are taken by tourists \(red\) vs locals \(blue\) - hfutrell on \/r\/sanfrancisco, 2015-05-
|
189
|
+
expect(replies.first).to match(/^Where photos in San Francisco are taken by tourists \(red\) vs locals \(blue\) - hfutrell on \/r\/sanfrancisco, 2015-05-1\d \(\d{3} points\) http:\/\/redd\.it\/35yr3b$/)
|
190
190
|
end
|
191
191
|
|
192
192
|
it "returns an appropriate message for a given link if it has not been submitted to reddit" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-snoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Chong
|
@@ -130,6 +130,7 @@ executables: []
|
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
|
+
- ".coveralls.yml"
|
133
134
|
- ".gitignore"
|
134
135
|
- ".travis.yml"
|
135
136
|
- Gemfile
|