lita-onewheel-beer-tin-bucket 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,155 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lita::Handlers::OnewheelBeerTinBucket, lita_handler: true do
4
+ it { is_expected.to route_command('tinbucket') }
5
+ it { is_expected.to route_command('tinbucket 4') }
6
+ it { is_expected.to route_command('tinbucket nitro') }
7
+ it { is_expected.to route_command('tinbucket CASK') }
8
+ it { is_expected.to route_command('tinbucket <$4') }
9
+ it { is_expected.to route_command('tinbucket < $4') }
10
+ it { is_expected.to route_command('tinbucket <=$4') }
11
+ it { is_expected.to route_command('tinbucket <= $4') }
12
+ it { is_expected.to route_command('tinbucket >4%') }
13
+ it { is_expected.to route_command('tinbucket > 4%') }
14
+ it { is_expected.to route_command('tinbucket >=4%') }
15
+ it { is_expected.to route_command('tinbucket >= 4%') }
16
+ it { is_expected.to route_command('tinbucketabvhigh') }
17
+ it { is_expected.to route_command('tinbucketabvlow') }
18
+
19
+ before do
20
+ mock = File.open('spec/fixtures/tinbucket.html').read
21
+ allow(RestClient).to receive(:get) { mock }
22
+ end
23
+
24
+ it 'shows the tinbucket taps' do
25
+ send_command 'tinbucket'
26
+ expect(replies.last).to eq("taps: 1) Block 15 Gloria! 2) Russian River Supplication 3) Prairie Artisan Ales Phantasmagoria 4) Block 15 Sticky Hands Hop Experience 5) Block 15 Alpha IPA 6) Goose Island Bourbon County Regal Rye Stout 7) Logsdon Farmhouse Peche 'n Brett 8) Bruery Gypsy Tart (PREMIUM) 9) Perennial Abraxas 10) Flat Tail Grape Drape 11) Prairie Artisan Ales BOMB! 12) Block 15 Hypnosis 13) pFriem Flanders Red 14) Flat Tail So Much Drama in the LBC 15) Block 15 Demon's Farm 16) AleSmith Hawaiian Speedway Stout 17) Russian River Temptation 18) Bend B-21 19) Prairie Artisan Ales Ales Vous Francais")
27
+ end
28
+
29
+ it 'displays details for tap 4' do
30
+ send_command 'tinbucket 4'
31
+ expect(replies.last).to eq('tinbucket tap 4) Blind Pig - IPA 6.1%, $6')
32
+ end
33
+
34
+ it 'doesn\'t explode on 1' do
35
+ send_command 'tinbucket 1'
36
+ expect(replies.count).to eq(1)
37
+ expect(replies.last).to eq('tinbucket tap 1) Aktien Helles Lager 5.3%, $5')
38
+ end
39
+
40
+ it 'gets nitro' do
41
+ send_command 'tinbucket nitro'
42
+ expect(replies.last).to eq('tinbucket tap 30) Nitro- Stout 4.1%, $4')
43
+ end
44
+
45
+ it 'searches for ipa' do
46
+ send_command 'tinbucket ipa'
47
+ expect(replies.last).to eq('tinbucket tap 50) WFO - IPA 7.5%, $5')
48
+ end
49
+
50
+ # it 'searches for brown' do
51
+ # send_command 'tinbucket brown'
52
+ # expect(replies.last).to eq("Bailey's tap 22) GoodLife 29er - India Brown Ale 6.0%, 10oz - $3 | 20oz - $5 | 32oz Crowler - $8, 37% remaining")
53
+ # end
54
+
55
+ it 'searches for abv >9%' do
56
+ send_command 'tinbucket >9%'
57
+ expect(replies.count).to eq(8)
58
+ expect(replies[0]).to eq('tinbucket tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
59
+ expect(replies[1]).to eq('tinbucket tap 3) Barrel Aged Old Thunderpussy 10.8%, $5')
60
+ expect(replies.last).to eq('tinbucket tap 46) Sump - Imp Coffee Stout 10.5%, $5')
61
+ end
62
+
63
+ it 'searches for abv > 9%' do
64
+ send_command 'tinbucket > 9%'
65
+ expect(replies.count).to eq(8)
66
+ expect(replies[0]).to eq('tinbucket tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
67
+ expect(replies[1]).to eq('tinbucket tap 3) Barrel Aged Old Thunderpussy 10.8%, $5')
68
+ expect(replies.last).to eq('tinbucket tap 46) Sump - Imp Coffee Stout 10.5%, $5')
69
+ end
70
+
71
+ it 'searches for abv >= 9%' do
72
+ send_command 'tinbucket >= 9%'
73
+ expect(replies.count).to eq(10)
74
+ expect(replies[0]).to eq('tinbucket tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
75
+ expect(replies.last).to eq('tinbucket tap 46) Sump - Imp Coffee Stout 10.5%, $5')
76
+ end
77
+
78
+ it 'searches for abv <4.1%' do
79
+ send_command 'tinbucket <4.1%'
80
+ expect(replies.count).to eq(2)
81
+ expect(replies[0]).to eq('tinbucket tap 15) Grapefruit Radler 2.5%, $5')
82
+ expect(replies.last).to eq('tinbucket tap 38) Prairie-Vous Francais - Saison   Just Tapped 3.9%, $5')
83
+ end
84
+
85
+ it 'searches for abv <= 4%' do
86
+ send_command 'tinbucket <= 4%'
87
+ expect(replies.count).to eq(2)
88
+ expect(replies[0]).to eq('tinbucket tap 15) Grapefruit Radler 2.5%, $5')
89
+ expect(replies.last).to eq('tinbucket tap 38) Prairie-Vous Francais - Saison   Just Tapped 3.9%, $5')
90
+ end
91
+
92
+ it 'searches for prices >$5' do
93
+ send_command 'tinbucket >$5'
94
+ expect(replies.count).to eq(11)
95
+ expect(replies[0]).to eq('tinbucket tap 4) Blind Pig - IPA 6.1%, $6')
96
+ expect(replies[1]).to eq('tinbucket tap 21) Kristallweissbier 5.4%, $6')
97
+ end
98
+
99
+ it 'searches for prices >=$6' do
100
+ send_command 'tinbucket >=$6'
101
+ expect(replies.count).to eq(11)
102
+ expect(replies[0]).to eq('tinbucket tap 4) Blind Pig - IPA 6.1%, $6')
103
+ end
104
+
105
+ it 'searches for prices > $6' do
106
+ send_command 'tinbucket > $6'
107
+ expect(replies.count).to eq(3)
108
+ expect(replies[0]).to eq('tinbucket tap 29) Nitro- Shake - Choco Porter 5.9%, $8')
109
+ end
110
+
111
+ it 'searches for prices <$4.1' do
112
+ send_command 'tinbucket <$4.1'
113
+ expect(replies.count).to eq(4)
114
+ expect(replies[0]).to eq('tinbucket tap 8) Cheap, cold 4.7%, $3')
115
+ end
116
+
117
+ it 'searches for prices < $4.01' do
118
+ send_command 'tinbucket < $4.01'
119
+ expect(replies.count).to eq(4)
120
+ expect(replies[0]).to eq('tinbucket tap 8) Cheap, cold 4.7%, $3')
121
+ end
122
+
123
+ it 'searches for prices <= $4.00' do
124
+ send_command 'tinbucket <= $4.00'
125
+ expect(replies.count).to eq(4)
126
+ expect(replies[0]).to eq('tinbucket tap 8) Cheap, cold 4.7%, $3')
127
+ end
128
+
129
+ it 'runs a random beer through' do
130
+ send_command 'tinbucket roulette'
131
+ expect(replies.count).to eq(1)
132
+ expect(replies.last).to include('tinbucket tap')
133
+ end
134
+
135
+ it 'runs a random beer through' do
136
+ send_command 'tinbucket random'
137
+ expect(replies.count).to eq(1)
138
+ expect(replies.last).to include('tinbucket tap')
139
+ end
140
+
141
+ it 'searches with a space' do
142
+ send_command 'tinbucket cider riot'
143
+ expect(replies.last).to eq('tinbucket tap 10) Cider- NeverGiveAnInch -Rosé 6.9%, $5')
144
+ end
145
+
146
+ it 'displays low abv' do
147
+ send_command 'tinbucketabvhigh'
148
+ expect(replies.last).to eq('tinbucket tap 31) Notorious - IIIPA 11.5%, $5')
149
+ end
150
+
151
+ it 'displays high abv' do
152
+ send_command 'tinbucketabvlow'
153
+ expect(replies.last).to eq('tinbucket tap 15) Grapefruit Radler 2.5%, $5')
154
+ end
155
+ end
@@ -0,0 +1,14 @@
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+ SimpleCov.formatters = [
4
+ SimpleCov::Formatter::HTMLFormatter,
5
+ Coveralls::SimpleCov::Formatter
6
+ ]
7
+ SimpleCov.start { add_filter '/spec/' }
8
+
9
+ require 'lita-onewheel-beer-tin-bucket'
10
+ require 'lita/rspec'
11
+
12
+ # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
13
+ # was generated with Lita 4, the compatibility mode should be left disabled.
14
+ Lita.version_3_compatibility_mode = false
metadata ADDED
@@ -0,0 +1,213 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lita-onewheel-beer-tin-bucket
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Kreps
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lita
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.7'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rest-client
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sanitize
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '4.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: lita-onewheel-beer-base
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.3'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '10.4'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '10.4'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rack-test
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.6'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.6'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.10'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.10'
153
+ - !ruby/object:Gem::Dependency
154
+ name: coveralls
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '0.8'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '0.8'
167
+ description: Lita interface to Tin Bucket's listings.
168
+ email:
169
+ - andrew.kreps@gmail.com
170
+ executables: []
171
+ extensions: []
172
+ extra_rdoc_files: []
173
+ files:
174
+ - ".gitignore"
175
+ - ".travis.yml"
176
+ - Gemfile
177
+ - README.md
178
+ - Rakefile
179
+ - lib/lita-onewheel-beer-tin-bucket.rb
180
+ - lib/lita/handlers/onewheel_beer_tin_bucket.rb
181
+ - lita-onewheel-beer-tin-bucket.gemspec
182
+ - spec/fixtures/tinbucket.html
183
+ - spec/lita/handlers/onewheel_beer_tin_bucket_spec.rb
184
+ - spec/spec_helper.rb
185
+ homepage: https://github.com/onewheelskyward/lita-onewheel-beer-tin-bucket
186
+ licenses:
187
+ - MIT
188
+ metadata:
189
+ lita_plugin_type: handler
190
+ post_install_message:
191
+ rdoc_options: []
192
+ require_paths:
193
+ - lib
194
+ required_ruby_version: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ required_rubygems_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - ">="
202
+ - !ruby/object:Gem::Version
203
+ version: '0'
204
+ requirements: []
205
+ rubyforge_project:
206
+ rubygems_version: 2.5.1
207
+ signing_key:
208
+ specification_version: 4
209
+ summary: See above.
210
+ test_files:
211
+ - spec/fixtures/tinbucket.html
212
+ - spec/lita/handlers/onewheel_beer_tin_bucket_spec.rb
213
+ - spec/spec_helper.rb