lita-onewheel-election-cnn 3.0.2 → 3.1.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: 9ffdce43ce0663e40c0243ca5b7b4e5f20b2c1be
4
- data.tar.gz: 10f84a8bc0124f72e20de0aa7489fd1920285a14
3
+ metadata.gz: 80a14d04e9bb68796e73c74a2af75d1e27d2cd3c
4
+ data.tar.gz: ca4c6d08d13667bfe89e1816649f781865e0c659
5
5
  SHA512:
6
- metadata.gz: 3ae7e0a146d0ea6902d7d0af89e5004d3b473adb9d0c6033e7ff0294d90c076297231538c96455f974663e438b751d1b9799cab7c1f206ec2156643dc7c15451
7
- data.tar.gz: 28c39eb7b418884c02edc62f23d547528ed26faf65aa45c1d1b9efaa2def61747db11e9da0a550c29e7049bf85fb61739b6a748f04d67cdc9f1342e5fc53251f
6
+ metadata.gz: eb0b45260df8748c39dd88c0303e49b1600994197cb15b5b19dd02fb74a82db6e0b0a48f2bc7056098c64d62d2350f3683d278860c2377962aca09be47b9ecf4
7
+ data.tar.gz: 0e222f45c90a56e845bc37dbd3582ac46acaae3b54b6989628775fe940164e5f58f02ebe5a20704ac97ee02b6cf523d2d65def2f1f59c799b703b4b64a50dad6
@@ -27,8 +27,8 @@ module Lita
27
27
 
28
28
  results['candidates'].each do |candidate|
29
29
  candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
30
- candidate_str += "#{candidate['pctDecimal']}%"
31
- candidate_str += " WINNER! #{candidate['evotes']} electoral votes." if candidate['winner']
30
+ candidate_str += "#{candidate['pctDecimal']}%, #{candidate['evotes']} electoral votes."
31
+ candidate_str += " WINNER! " if candidate['winner']
32
32
  Lita.logger.debug "Replying with #{candidate_str}"
33
33
  response.reply candidate_str
34
34
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-election-cnn'
3
- spec.version = '3.0.2'
3
+ spec.version = '3.1.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.}
@@ -3019,7 +3019,7 @@
3019
3019
  "cvotes": "0",
3020
3020
  "vpct": 0,
3021
3021
  "pctDecimal": "0.0",
3022
- "evotes": 0
3022
+ "evotes": 19
3023
3023
  }
3024
3024
  ],
3025
3025
  "lts": 1478619781013
@@ -10,16 +10,16 @@ describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
10
10
  mock = File.open('spec/fixtures/election.json').read
11
11
  allow(RestClient).to receive(:get) { mock }
12
12
  send_command 'election'
13
- expect(replies[0]).to eq("Hillary Clinton: 0.0%")
14
- expect(replies[1]).to eq("Donald Trump: 0.0%")
13
+ expect(replies[0]).to eq("Hillary Clinton: 0.0%, 0 electoral votes.")
14
+ expect(replies[1]).to eq("Donald Trump: 0.0%, 19 electoral votes.")
15
15
  end
16
16
 
17
17
  it 'shows a winner' do
18
18
  mock = File.open('spec/fixtures/winner.json').read
19
19
  allow(RestClient).to receive(:get) { mock }
20
20
  send_command 'election'
21
- expect(replies[0]).to eq("Hillary Clinton: 0.0% WINNER! 0 electoral votes.")
22
- expect(replies[1]).to eq("Donald Trump: 0.0%")
21
+ expect(replies[0]).to eq("Hillary Clinton: 0.0%, 0 electoral votes. WINNER! ")
22
+ expect(replies[1]).to eq("Donald Trump: 0.0%, 0 electoral votes.")
23
23
  end
24
24
 
25
25
  it 'shows by state' do
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: 3.0.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps