cinch-urbandict 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -2
- data/cinch-urbandict.gemspec +3 -2
- data/lib/cinch/plugins/urbandict/urbandict.rb +2 -2
- data/lib/cinch/plugins/urbandict/version.rb +1 -1
- data/spec/cinch-urbandict_spec.rb +8 -7
- data/spec/spec_helper.rb +1 -19
- metadata +25 -9
data/.travis.yml
CHANGED
data/cinch-urbandict.gemspec
CHANGED
@@ -20,8 +20,9 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_development_dependency 'rake'
|
21
21
|
gem.add_development_dependency 'rspec'
|
22
22
|
gem.add_development_dependency 'coveralls'
|
23
|
+
gem.add_development_dependency 'cinch-test'
|
23
24
|
|
24
25
|
gem.add_dependency 'cinch', '~> 2.0.4'
|
25
|
-
gem.add_dependency 'cinch-toolbox', '
|
26
|
-
gem.add_dependency 'cinch-cooldown', '~> 1.0.
|
26
|
+
gem.add_dependency 'cinch-toolbox', '~> 1.0.3'
|
27
|
+
gem.add_dependency 'cinch-cooldown', '~> 1.0.1'
|
27
28
|
end
|
@@ -2,28 +2,29 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe Cinch::Plugins::UrbanDict do
|
5
|
+
include Cinch::Test
|
5
6
|
|
6
7
|
before(:all) do
|
7
|
-
@
|
8
|
+
@bot = make_bot(Cinch::Plugins::UrbanDict)
|
8
9
|
end
|
9
10
|
|
10
11
|
it 'should allow users to search for words' do
|
11
|
-
@
|
12
|
+
get_replies(make_message(@bot, '!ud dork')).first.text.
|
12
13
|
should match('Someone who has odd interests')
|
13
14
|
end
|
14
15
|
|
15
16
|
it 'should not return nil for valid searches' do
|
16
|
-
@
|
17
|
+
get_replies(make_message(@bot, '!ud dork')).first.text.
|
17
18
|
should_not be_nil
|
18
19
|
end
|
19
20
|
|
20
21
|
it 'should return an error for invalid searches' do
|
21
|
-
@
|
22
|
-
should == "Urban Dictionary ∴ 7zJ6t8rT8p384My: No definition available."
|
22
|
+
get_replies(make_message(@bot, '!ud 7zJ6t8rT8p384My')).first.text.
|
23
|
+
should == "test: Urban Dictionary ∴ 7zJ6t8rT8p384My: No definition available."
|
23
24
|
end
|
24
25
|
|
25
|
-
it 'should not
|
26
|
-
response = @
|
26
|
+
it 'should not return multiple lines for a definition with breaks' do
|
27
|
+
response = get_replies(make_message(@bot, '!ud dong')).first.text
|
27
28
|
response.should_not match("<br")
|
28
29
|
response.should_not match("\r")
|
29
30
|
response.should_not match("\n")
|
data/spec/spec_helper.rb
CHANGED
@@ -1,22 +1,4 @@
|
|
1
1
|
require 'coveralls'
|
2
2
|
Coveralls.wear!
|
3
3
|
require 'cinch-urbandict'
|
4
|
-
|
5
|
-
def fake_bot
|
6
|
-
bot = Cinch::Bot.new
|
7
|
-
bot.loggers.level = :fatal
|
8
|
-
bot
|
9
|
-
return bot
|
10
|
-
end
|
11
|
-
|
12
|
-
module Cinch
|
13
|
-
module Plugin
|
14
|
-
def initialize(opts = {})
|
15
|
-
@bot = fake_bot
|
16
|
-
@handlers = []
|
17
|
-
@timers = []
|
18
|
-
# Don't init the bot
|
19
|
-
# __register
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
4
|
+
require 'cinch/test'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinch-urbandict
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -59,6 +59,22 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: cinch-test
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
62
78
|
- !ruby/object:Gem::Dependency
|
63
79
|
name: cinch
|
64
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,17 +96,17 @@ dependencies:
|
|
80
96
|
requirement: !ruby/object:Gem::Requirement
|
81
97
|
none: false
|
82
98
|
requirements:
|
83
|
-
- -
|
99
|
+
- - ~>
|
84
100
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.0.
|
101
|
+
version: 1.0.3
|
86
102
|
type: :runtime
|
87
103
|
prerelease: false
|
88
104
|
version_requirements: !ruby/object:Gem::Requirement
|
89
105
|
none: false
|
90
106
|
requirements:
|
91
|
-
- -
|
107
|
+
- - ~>
|
92
108
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.0.
|
109
|
+
version: 1.0.3
|
94
110
|
- !ruby/object:Gem::Dependency
|
95
111
|
name: cinch-cooldown
|
96
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +114,7 @@ dependencies:
|
|
98
114
|
requirements:
|
99
115
|
- - ~>
|
100
116
|
- !ruby/object:Gem::Version
|
101
|
-
version: 1.0.
|
117
|
+
version: 1.0.1
|
102
118
|
type: :runtime
|
103
119
|
prerelease: false
|
104
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +122,7 @@ dependencies:
|
|
106
122
|
requirements:
|
107
123
|
- - ~>
|
108
124
|
- !ruby/object:Gem::Version
|
109
|
-
version: 1.0.
|
125
|
+
version: 1.0.1
|
110
126
|
description: Cinch Plugin to fetch definition data from Urban Dictionary
|
111
127
|
email:
|
112
128
|
- bhaberer@gmail.com
|
@@ -146,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
162
|
version: '0'
|
147
163
|
requirements: []
|
148
164
|
rubyforge_project:
|
149
|
-
rubygems_version: 1.8.
|
165
|
+
rubygems_version: 1.8.25
|
150
166
|
signing_key:
|
151
167
|
specification_version: 3
|
152
168
|
summary: Cinch Plugin for Urban Dictionary
|