lita-onewheel-election-cnn 1.1.0 → 2.0.0
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: a230237c43d961c274327d58c8aeae5e1ea8614c
|
4
|
+
data.tar.gz: af185e979ca24f2d89a5e17fe9aaf30801769cfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a5135d0c3ab115acafe76ad9783b762087bde501b30ea64d1011327d1deae799fd3630fdf4a8646d9de1e72ec385803840768631c6b1ed7bb141471617cc75
|
7
|
+
data.tar.gz: d0d2f7e97441f2738486bb0eaf05efc3d770538b029621b93db07bc5957f30dd09f3bceacdee8cf5cff8929771a8fd90483b35665729b3096fc3eaf6db6b8893
|
@@ -34,7 +34,7 @@ module Lita
|
|
34
34
|
results['races'].each do |race|
|
35
35
|
if race['state'].downcase == state.downcase
|
36
36
|
race['candidates'].each do |candidate|
|
37
|
-
candidate_str = "#{state} - #{candidate['fname']} #{candidate['lname']}: "
|
37
|
+
candidate_str = "#{state} (#{race['evotes']} electoral votes) - #{candidate['fname']} #{candidate['lname']}: "
|
38
38
|
candidate_str += "#{candidate['pctDecimal']}%"
|
39
39
|
candidate_str += " WINNER! #{candidate['evotes']} electoral votes." if candidate['winner']
|
40
40
|
response.reply candidate_str
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-election-cnn'
|
3
|
-
spec.version = '
|
3
|
+
spec.version = '2.0.0'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = %q{Lita interface to CNN's 2016 Presidential Election JSON.}
|
@@ -23,23 +23,23 @@ describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
|
|
23
23
|
mock = File.open('spec/fixtures/election.json').read
|
24
24
|
allow(RestClient).to receive(:get) { mock }
|
25
25
|
send_command 'election va'
|
26
|
-
expect(replies[0]).to eq("Virginia - Hillary Clinton: 0.0%")
|
27
|
-
expect(replies[1]).to eq("Virginia - Donald Trump: 0.0%")
|
26
|
+
expect(replies[0]).to eq("Virginia (13 electoral votes) - Hillary Clinton: 0.0%")
|
27
|
+
expect(replies[1]).to eq("Virginia (13 electoral votes) - Donald Trump: 0.0%")
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'shows by STATE' do
|
31
31
|
mock = File.open('spec/fixtures/election.json').read
|
32
32
|
allow(RestClient).to receive(:get) { mock }
|
33
33
|
send_command 'election VA'
|
34
|
-
expect(replies[0]).to eq("Virginia - Hillary Clinton: 0.0%")
|
35
|
-
expect(replies[1]).to eq("Virginia - Donald Trump: 0.0%")
|
34
|
+
expect(replies[0]).to eq("Virginia (13 electoral votes) - Hillary Clinton: 0.0%")
|
35
|
+
expect(replies[1]).to eq("Virginia (13 electoral votes) - Donald Trump: 0.0%")
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'shows by full state name downcase' do
|
39
39
|
mock = File.open('spec/fixtures/election.json').read
|
40
40
|
allow(RestClient).to receive(:get) { mock }
|
41
41
|
send_command 'election new york'
|
42
|
-
expect(replies[0]).to eq("NEW YORK - Hillary Clinton: 0.0%")
|
43
|
-
expect(replies[1]).to eq("NEW YORK - Donald Trump: 0.0%")
|
42
|
+
expect(replies[0]).to eq("NEW YORK (29 electoral votes) - Hillary Clinton: 0.0%")
|
43
|
+
expect(replies[1]).to eq("NEW YORK (29 electoral votes) - Donald Trump: 0.0%")
|
44
44
|
end
|
45
45
|
end
|