lita-onewheel-beer-loyal-legion 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.travis.yml +16 -0
- data/Gemfile +6 -0
- data/README.md +30 -0
- data/Rakefile +6 -0
- data/lib/lita/handlers/onewheel_beer_loyal_legion.rb +104 -0
- data/lib/lita-onewheel-beer-loyal-legion.rb +12 -0
- data/lita-onewheel-beer-loyal-legion.gemspec +31 -0
- data/spec/fixtures/loyallegion.html +3036 -0
- data/spec/lita/handlers/onewheel_beer_loyal_legion_spec.rb +155 -0
- data/spec/spec_helper.rb +14 -0
- metadata +213 -0
@@ -0,0 +1,155 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Lita::Handlers::OnewheelBeerLoyalLegion, lita_handler: true do
|
4
|
+
it { is_expected.to route_command('loyallegion') }
|
5
|
+
it { is_expected.to route_command('loyallegion 4') }
|
6
|
+
it { is_expected.to route_command('loyallegion nitro') }
|
7
|
+
it { is_expected.to route_command('loyallegion CASK') }
|
8
|
+
it { is_expected.to route_command('loyallegion <$4') }
|
9
|
+
it { is_expected.to route_command('loyallegion < $4') }
|
10
|
+
it { is_expected.to route_command('loyallegion <=$4') }
|
11
|
+
it { is_expected.to route_command('loyallegion <= $4') }
|
12
|
+
it { is_expected.to route_command('loyallegion >4%') }
|
13
|
+
it { is_expected.to route_command('loyallegion > 4%') }
|
14
|
+
it { is_expected.to route_command('loyallegion >=4%') }
|
15
|
+
it { is_expected.to route_command('loyallegion >= 4%') }
|
16
|
+
it { is_expected.to route_command('loyallegionabvhigh') }
|
17
|
+
it { is_expected.to route_command('loyallegionabvlow') }
|
18
|
+
|
19
|
+
before do
|
20
|
+
mock = File.open('spec/fixtures/loyallegion.html').read
|
21
|
+
allow(RestClient).to receive(:get) { mock }
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'shows the loyallegion taps' do
|
25
|
+
send_command 'loyallegion'
|
26
|
+
expect(replies.last).to eq("taps: 1) Bayreuther Aktien Helles Lager 2) Boneyard Armored Fist - Big,Black&Hoppy 3) Magnolia Barrel Aged Old Thunderpussy 4) Russian River Blind Pig - IPA 5) Magnolia Blue Bell Bitter 6) Boneyard Bone-A-Fide - Pale 7) Knee Deep Breaking Bud - IPA 8) Hamm's Cheap, cold 9) Two Rivers Cider- Huckleberry 10) Cider Riot! Cider- NeverGiveAnInch -Rosé 11) Bockor Cuvée des Jacobins Rouge* 12) Magnolia Delilah Jones '15 - StrongRye 13) Alpine Duet - IPA 14) NewBelg&HofTenDormaal Golden - Herbs,Seeds,Spelt 15) Stiegl Grapefruit Radler 16) Barley Brown's Handtruck - Pale 17) Barley Brown's Head Shake - IIPA 18) Boneyard Hop Venom - IIPA 19) Ayinger Jahrhundert - Export Lager 20) Magnolia Kalifornia Kolsch 21) Weihenstephan Kristallweissbier 22) New Belgium Le Terroir* 23) Knee Deep Lupulin River - IPA 24) Gebruder Maisel Maisel's Weisse - Hefeweizen 25) Hair of the Dog Nitro- Adam -Drinking Tobacco 26) Dieu du Ciel! Nitro- Aphrodisiaque - Stout 27) North Coast Nitro- Old Rasputin - RIS 28) North Coast Nitro- Red Seal - Red 29) Boulder Nitro- Shake - Choco Porter 30) Guinness Nitro- Stout 31) Boneyard Notorious - IIIPA 32) Crux Off Leash - NW Session Ale 33) Rogue Old Crustacean '12-Barleywine 34) Barley Brown's Pallet Jack - IPA 35) Prairie Phantasmagoria - IPA 36) Radeberger Pilsner 37) Russian River Pliny The Elder 38) Prairie Prairie-Vous Francais - Saison Just Tapped 39) Magnolia Proving Ground - IPA 40) Crux Prowell Springs - Pilsner 41) Dupont Saison 42) Magnolia Saison de Lily 43) Against the Grain Sho' Nuff - Belgian Pale 44) To Øl Simple Life - Lacto Saison* 45) Magnolia Stout of Circumstance 46) Perennial Sump - Imp Coffee Stout 47) Against the Grain Tex Arcana - Stout 48) Bosteels Tripel Karmeliet 49) Gigantic Vivid - IIPA 50) Barley Brown's WFO - IPA")
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'displays details for tap 4' do
|
30
|
+
send_command 'loyallegion 4'
|
31
|
+
expect(replies.last).to eq('loyallegion tap 4) Blind Pig - IPA 6.1%, $6')
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'doesn\'t explode on 1' do
|
35
|
+
send_command 'loyallegion 1'
|
36
|
+
expect(replies.count).to eq(1)
|
37
|
+
expect(replies.last).to eq('loyallegion tap 1) Aktien Helles Lager 5.3%, $5')
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'gets nitro' do
|
41
|
+
send_command 'loyallegion nitro'
|
42
|
+
expect(replies.last).to eq('loyallegion tap 30) Nitro- Stout 4.1%, $4')
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'searches for ipa' do
|
46
|
+
send_command 'loyallegion ipa'
|
47
|
+
expect(replies.last).to eq('loyallegion tap 50) WFO - IPA 7.5%, $5')
|
48
|
+
end
|
49
|
+
|
50
|
+
# it 'searches for brown' do
|
51
|
+
# send_command 'loyallegion 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 'loyallegion >9%'
|
57
|
+
expect(replies.count).to eq(8)
|
58
|
+
expect(replies[0]).to eq('loyallegion tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
|
59
|
+
expect(replies[1]).to eq('loyallegion tap 3) Barrel Aged Old Thunderpussy 10.8%, $5')
|
60
|
+
expect(replies.last).to eq('loyallegion tap 46) Sump - Imp Coffee Stout 10.5%, $5')
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'searches for abv > 9%' do
|
64
|
+
send_command 'loyallegion > 9%'
|
65
|
+
expect(replies.count).to eq(8)
|
66
|
+
expect(replies[0]).to eq('loyallegion tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
|
67
|
+
expect(replies[1]).to eq('loyallegion tap 3) Barrel Aged Old Thunderpussy 10.8%, $5')
|
68
|
+
expect(replies.last).to eq('loyallegion tap 46) Sump - Imp Coffee Stout 10.5%, $5')
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'searches for abv >= 9%' do
|
72
|
+
send_command 'loyallegion >= 9%'
|
73
|
+
expect(replies.count).to eq(10)
|
74
|
+
expect(replies[0]).to eq('loyallegion tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
|
75
|
+
expect(replies.last).to eq('loyallegion tap 46) Sump - Imp Coffee Stout 10.5%, $5')
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'searches for abv <4.1%' do
|
79
|
+
send_command 'loyallegion <4.1%'
|
80
|
+
expect(replies.count).to eq(2)
|
81
|
+
expect(replies[0]).to eq('loyallegion tap 15) Grapefruit Radler 2.5%, $5')
|
82
|
+
expect(replies.last).to eq('loyallegion tap 38) Prairie-Vous Francais - Saison Just Tapped 3.9%, $5')
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'searches for abv <= 4%' do
|
86
|
+
send_command 'loyallegion <= 4%'
|
87
|
+
expect(replies.count).to eq(2)
|
88
|
+
expect(replies[0]).to eq('loyallegion tap 15) Grapefruit Radler 2.5%, $5')
|
89
|
+
expect(replies.last).to eq('loyallegion tap 38) Prairie-Vous Francais - Saison Just Tapped 3.9%, $5')
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'searches for prices >$5' do
|
93
|
+
send_command 'loyallegion >$5'
|
94
|
+
expect(replies.count).to eq(11)
|
95
|
+
expect(replies[0]).to eq('loyallegion tap 4) Blind Pig - IPA 6.1%, $6')
|
96
|
+
expect(replies[1]).to eq('loyallegion tap 21) Kristallweissbier 5.4%, $6')
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'searches for prices >=$6' do
|
100
|
+
send_command 'loyallegion >=$6'
|
101
|
+
expect(replies.count).to eq(11)
|
102
|
+
expect(replies[0]).to eq('loyallegion tap 4) Blind Pig - IPA 6.1%, $6')
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'searches for prices > $6' do
|
106
|
+
send_command 'loyallegion > $6'
|
107
|
+
expect(replies.count).to eq(3)
|
108
|
+
expect(replies[0]).to eq('loyallegion tap 29) Nitro- Shake - Choco Porter 5.9%, $8')
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'searches for prices <$4.1' do
|
112
|
+
send_command 'loyallegion <$4.1'
|
113
|
+
expect(replies.count).to eq(4)
|
114
|
+
expect(replies[0]).to eq('loyallegion tap 8) Cheap, cold 4.7%, $3')
|
115
|
+
end
|
116
|
+
|
117
|
+
it 'searches for prices < $4.01' do
|
118
|
+
send_command 'loyallegion < $4.01'
|
119
|
+
expect(replies.count).to eq(4)
|
120
|
+
expect(replies[0]).to eq('loyallegion tap 8) Cheap, cold 4.7%, $3')
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'searches for prices <= $4.00' do
|
124
|
+
send_command 'loyallegion <= $4.00'
|
125
|
+
expect(replies.count).to eq(4)
|
126
|
+
expect(replies[0]).to eq('loyallegion tap 8) Cheap, cold 4.7%, $3')
|
127
|
+
end
|
128
|
+
|
129
|
+
it 'runs a random beer through' do
|
130
|
+
send_command 'loyallegion roulette'
|
131
|
+
expect(replies.count).to eq(1)
|
132
|
+
expect(replies.last).to include('loyallegion tap')
|
133
|
+
end
|
134
|
+
|
135
|
+
it 'runs a random beer through' do
|
136
|
+
send_command 'loyallegion random'
|
137
|
+
expect(replies.count).to eq(1)
|
138
|
+
expect(replies.last).to include('loyallegion tap')
|
139
|
+
end
|
140
|
+
|
141
|
+
it 'searches with a space' do
|
142
|
+
send_command 'loyallegion cider riot'
|
143
|
+
expect(replies.last).to eq('loyallegion tap 10) Cider- NeverGiveAnInch -Rosé 6.9%, $5')
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'displays low abv' do
|
147
|
+
send_command 'loyallegionabvhigh'
|
148
|
+
expect(replies.last).to eq('loyallegion tap 31) Notorious - IIIPA 11.5%, $5')
|
149
|
+
end
|
150
|
+
|
151
|
+
it 'displays high abv' do
|
152
|
+
send_command 'loyallegionabvlow'
|
153
|
+
expect(replies.last).to eq('loyallegion tap 15) Grapefruit Radler 2.5%, $5')
|
154
|
+
end
|
155
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -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-loyal-legion'
|
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-loyal-legion
|
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 Loyal Legion'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-loyal-legion.rb
|
180
|
+
- lib/lita/handlers/onewheel_beer_loyal_legion.rb
|
181
|
+
- lita-onewheel-beer-loyal-legion.gemspec
|
182
|
+
- spec/fixtures/loyallegion.html
|
183
|
+
- spec/lita/handlers/onewheel_beer_loyal_legion_spec.rb
|
184
|
+
- spec/spec_helper.rb
|
185
|
+
homepage: https://github.com/onewheelskyward/lita-onewheel-beer-loyal-legion
|
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/loyallegion.html
|
212
|
+
- spec/lita/handlers/onewheel_beer_loyal_legion_spec.rb
|
213
|
+
- spec/spec_helper.rb
|