lita-onewheel-election-cnn 0.1.1 → 1.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: fc14910bc3ee2dd0197878a48011810880415c9c
4
- data.tar.gz: 5d0d58917f4fc4f64dc6c98da90934d3c8399166
3
+ metadata.gz: 669927ae2a817959294a84557384f23c851a788d
4
+ data.tar.gz: c99f0e169bd5987696b8a3ba1e9ab7ab2d0fcdce
5
5
  SHA512:
6
- metadata.gz: 080637ed81397764c512cc1d19263610c77f551b31628e1f1ec255560e129ccf0ce23858cb6dc0e429356274d5a33f41ab0423e992ea84e4c2b14bdd59c2957b
7
- data.tar.gz: 78b99eabecbac45c9b981fe28458afd032c7c18c0299fff1b3740d967e33bc495e08fd81ee5f99a6e5fbf3a95217942b918d52ae73db928ee910d9a324e145a5
6
+ metadata.gz: 46aa24e24e65c385f624259b3a3b366371affcffe90ed6a80769aac2053f9a6c0d3259464bcc9fad758ffb09a19c8e0fe22ad5fe687c566844579247e4d6d635
7
+ data.tar.gz: 04f5b2e56a31625dfe3d7e2d540a946037b231f903ccc77ab5aee4966d0f614ad85c4bd2afbb6ac7f33409ccec3ba86b4347db6fab5b487be182d9460a544e90
@@ -20,7 +20,7 @@ module Lita
20
20
  results['candidates'].each do |candidate|
21
21
  candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
22
22
  candidate_str += "WINNER! " if candidate['winner']
23
- candidate_str += "#{candidate['pctDecimal']}%, (#{candidate['votes']})"
23
+ candidate_str += "#{candidate['pctDecimal']}%, #{candidate['evotes']} electoral votes."
24
24
  response.reply candidate_str
25
25
  end
26
26
  end
@@ -36,7 +36,7 @@ module Lita
36
36
  race['candidates'].each do |candidate|
37
37
  candidate_str = "#{state} - #{candidate['fname']} #{candidate['lname']}: "
38
38
  candidate_str += "WINNER! " if candidate['winner']
39
- candidate_str += "#{candidate['pctDecimal']}%, (#{candidate['votes']})"
39
+ candidate_str += "#{candidate['pctDecimal']}%, #{candidate['evotes']} electoral votes."
40
40
  response.reply candidate_str
41
41
  end
42
42
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-election-cnn'
3
- spec.version = '0.1.1'
3
+ spec.version = '1.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.}
@@ -7,39 +7,39 @@ describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
7
7
  mock = File.open('spec/fixtures/election.json').read
8
8
  allow(RestClient).to receive(:get) { mock }
9
9
  send_command 'election'
10
- expect(replies[0]).to eq("Hillary Clinton: 0.0%, 0% of precincts reporting.")
11
- expect(replies[1]).to eq("Donald Trump: 0.0%, 0% of precincts reporting.")
10
+ expect(replies[0]).to eq("Hillary Clinton: 0.0%, 0 electoral votes.")
11
+ expect(replies[1]).to eq("Donald Trump: 0.0%, 0 electoral votes.")
12
12
  end
13
13
 
14
14
  it 'shows a winner' do
15
15
  mock = File.open('spec/fixtures/winner.json').read
16
16
  allow(RestClient).to receive(:get) { mock }
17
17
  send_command 'election'
18
- expect(replies[0]).to eq("Hillary Clinton: WINNER! 0.0%, 0% of precincts reporting.")
19
- expect(replies[1]).to eq("Donald Trump: 0.0%, 0% of precincts reporting.")
18
+ expect(replies[0]).to eq("Hillary Clinton: WINNER! 0.0%, 0 electoral votes.")
19
+ expect(replies[1]).to eq("Donald Trump: 0.0%, 0 electoral votes.")
20
20
  end
21
21
 
22
22
  it 'shows by state' 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%, 0% of precincts reporting.")
27
- expect(replies[1]).to eq("Virginia - Donald Trump: 0.0%, 0% of precincts reporting.")
26
+ expect(replies[0]).to eq("Virginia - Hillary Clinton: 0.0%, 0 electoral votes.")
27
+ expect(replies[1]).to eq("Virginia - Donald Trump: 0.0%, 0 electoral votes.")
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%, 0% of precincts reporting.")
35
- expect(replies[1]).to eq("Virginia - Donald Trump: 0.0%, 0% of precincts reporting.")
34
+ expect(replies[0]).to eq("Virginia - Hillary Clinton: 0.0%, 0 electoral votes.")
35
+ expect(replies[1]).to eq("Virginia - Donald Trump: 0.0%, 0 electoral votes.")
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%, 0% of precincts reporting.")
43
- expect(replies[1]).to eq("NEW YORK - Donald Trump: 0.0%, 0% of precincts reporting.")
42
+ expect(replies[0]).to eq("NEW YORK - Hillary Clinton: 0.0%, 0 electoral votes.")
43
+ expect(replies[1]).to eq("NEW YORK - Donald Trump: 0.0%, 0 electoral votes.")
44
44
  end
45
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-election-cnn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps