lita-onewheel-election-cnn 3.5.0 → 3.6.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: 9204e6010d3100ba623910d38991d6cd23b6ae30
|
4
|
+
data.tar.gz: d12a8b7b57ef7411e39c055b072ab71f8e643be1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78cb472ab0f4e46924611d34eb1fa2f5c2b615c3ca6f1d2f475b747578d60c7bf5b4041b62f292580ded67da7d4c5eff208c7467269278776ebfddb484028e6c
|
7
|
+
data.tar.gz: 630afacfe893f1b30891688f02c35c61b7de25276879581754033f24bc4a8a26a403957672857d64c352ff1b36eb30b2f3b541135f71bde13402283cc7065e75
|
@@ -33,7 +33,7 @@ module Lita
|
|
33
33
|
response.reply "United States 2016 Presidential Election, #{results['races'][0]['pctsrep']}% reporting."
|
34
34
|
results['candidates'].each do |candidate|
|
35
35
|
candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
|
36
|
-
candidate_str += "#{candidate['pctDecimal']}%, #{candidate['evotes']} electoral votes."
|
36
|
+
candidate_str += "#{candidate['pctDecimal']}%, #{candidate['cvotes']} popular votes, #{candidate['evotes']} electoral votes."
|
37
37
|
candidate_str += " WINNER! " if candidate['winner']
|
38
38
|
Lita.logger.debug "Replying with #{candidate_str}"
|
39
39
|
response.reply candidate_str
|
@@ -53,7 +53,7 @@ module Lita
|
|
53
53
|
Lita.logger.debug "Replying with #{state_reply}"
|
54
54
|
race['candidates'].each do |candidate|
|
55
55
|
candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
|
56
|
-
candidate_str += "#{candidate['pctDecimal']}
|
56
|
+
candidate_str += "#{candidate['pctDecimal']}%, #{candidate['cvotes']} popular votes"
|
57
57
|
candidate_str += " WINNER! #{candidate['evotes']} electoral votes." if candidate['winner']
|
58
58
|
Lita.logger.debug "Replying with #{candidate_str}"
|
59
59
|
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.
|
3
|
+
spec.version = '3.6.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.}
|
@@ -12,8 +12,8 @@ describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
|
|
12
12
|
allow(RestClient).to receive(:get) { mock }
|
13
13
|
send_command 'election'
|
14
14
|
expect(replies[0]).to eq("United States 2016 Presidential Election, 1% reporting.")
|
15
|
-
expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 electoral votes.")
|
16
|
-
expect(replies[2]).to eq("Donald Trump: 0.0%, 19 electoral votes.")
|
15
|
+
expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 popular votes, 0 electoral votes.")
|
16
|
+
expect(replies[2]).to eq("Donald Trump: 0.0%, 0 popular votes, 19 electoral votes.")
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'shows a winner' do
|
@@ -21,8 +21,8 @@ describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
|
|
21
21
|
allow(RestClient).to receive(:get) { mock }
|
22
22
|
send_command 'election'
|
23
23
|
expect(replies[0]).to eq("United States 2016 Presidential Election, 1% reporting.")
|
24
|
-
expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 electoral votes. WINNER! ")
|
25
|
-
expect(replies[2]).to eq("Donald Trump: 0.0%, 0 electoral votes.")
|
24
|
+
expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 popular votes, 0 electoral votes. WINNER! ")
|
25
|
+
expect(replies[2]).to eq("Donald Trump: 0.0%, 0 popular votes, 0 electoral votes.")
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'shows by state' do
|
@@ -30,8 +30,8 @@ describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
|
|
30
30
|
allow(RestClient).to receive(:get) { mock }
|
31
31
|
send_command 'election va'
|
32
32
|
expect(replies[0]).to eq("Virginia, 13 electoral votes, 0% reporting")
|
33
|
-
expect(replies[1]).to eq("Hillary Clinton: 0.0
|
34
|
-
expect(replies[2]).to eq("Donald Trump: 0.0
|
33
|
+
expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 popular votes")
|
34
|
+
expect(replies[2]).to eq("Donald Trump: 0.0%, 0 popular votes")
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'shows by STATE' do
|
@@ -39,8 +39,8 @@ describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
|
|
39
39
|
allow(RestClient).to receive(:get) { mock }
|
40
40
|
send_command 'election VA'
|
41
41
|
expect(replies[0]).to eq("Virginia, 13 electoral votes, 0% reporting")
|
42
|
-
expect(replies[1]).to eq("Hillary Clinton: 0.0
|
43
|
-
expect(replies[2]).to eq("Donald Trump: 0.0
|
42
|
+
expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 popular votes")
|
43
|
+
expect(replies[2]).to eq("Donald Trump: 0.0%, 0 popular votes")
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'shows by full state name downcase' do
|
@@ -48,8 +48,8 @@ describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
|
|
48
48
|
allow(RestClient).to receive(:get) { mock }
|
49
49
|
send_command 'election new york'
|
50
50
|
expect(replies[0]).to eq("NEW YORK, 29 electoral votes, 0% reporting")
|
51
|
-
expect(replies[1]).to eq("Hillary Clinton: 0.0
|
52
|
-
expect(replies[2]).to eq("Donald Trump: 0.0
|
51
|
+
expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 popular votes")
|
52
|
+
expect(replies[2]).to eq("Donald Trump: 0.0%, 0 popular votes")
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'ansis' do
|