lita-onewheel-election-cnn 3.1.0 → 3.2.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: 80a14d04e9bb68796e73c74a2af75d1e27d2cd3c
4
- data.tar.gz: ca4c6d08d13667bfe89e1816649f781865e0c659
3
+ metadata.gz: b3bb1422abe3d459298c1eddf84b05980aa807c0
4
+ data.tar.gz: f263abdc2c27528407fae3b274c1d4e296bbb27d
5
5
  SHA512:
6
- metadata.gz: eb0b45260df8748c39dd88c0303e49b1600994197cb15b5b19dd02fb74a82db6e0b0a48f2bc7056098c64d62d2350f3683d278860c2377962aca09be47b9ecf4
7
- data.tar.gz: 0e222f45c90a56e845bc37dbd3582ac46acaae3b54b6989628775fe940164e5f58f02ebe5a20704ac97ee02b6cf523d2d65def2f1f59c799b703b4b64a50dad6
6
+ metadata.gz: 9d578ac031eb79186d3ffb39c2aefd86dfdd672e7f81777947a83d763f88ec29a3fa2aeeac2c1da71086d1963e3a050350c30d84708f1085793614d3b8aa37be
7
+ data.tar.gz: 0b026e66640dec66a32dd109d113b535a75a7620872a06ae5dcbbcb058c555ca6cdc9920fee5b53394fddd987f61fe0612fcb1a5461f5ba8b0d8335b91bbb742
@@ -25,6 +25,7 @@ module Lita
25
25
  Lita.logger.debug 'Getting election data'
26
26
  results = JSON.parse(RestClient.get('http://data.cnn.com/ELECTION/2016/full/P.full.json'))
27
27
 
28
+ response.reply "United States 2016 Presidential Election, #{results['races'][0]['pctsrep']}% reporting."
28
29
  results['candidates'].each do |candidate|
29
30
  candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
30
31
  candidate_str += "#{candidate['pctDecimal']}%, #{candidate['evotes']} electoral votes."
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-election-cnn'
3
- spec.version = '3.1.0'
3
+ spec.version = '3.2.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.}
@@ -26,7 +26,7 @@
26
26
  "cmap": false,
27
27
  "calltime": 0,
28
28
  "ts": 0,
29
- "pctsrep": 0,
29
+ "pctsrep": 1,
30
30
  "sw": false,
31
31
  "ip": "D",
32
32
  "candidates": [
@@ -26,7 +26,7 @@
26
26
  "cmap": false,
27
27
  "calltime": 0,
28
28
  "ts": 0,
29
- "pctsrep": 0,
29
+ "pctsrep": 1,
30
30
  "sw": false,
31
31
  "ip": "D",
32
32
  "candidates": [
@@ -10,16 +10,18 @@ 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%, 0 electoral votes.")
14
- expect(replies[1]).to eq("Donald Trump: 0.0%, 19 electoral votes.")
13
+ expect(replies[0]).to eq("United States 2016 Presidential Election, 1% reporting.")
14
+ expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 electoral votes.")
15
+ expect(replies[2]).to eq("Donald Trump: 0.0%, 19 electoral votes.")
15
16
  end
16
17
 
17
18
  it 'shows a winner' do
18
19
  mock = File.open('spec/fixtures/winner.json').read
19
20
  allow(RestClient).to receive(:get) { mock }
20
21
  send_command 'election'
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.")
22
+ expect(replies[0]).to eq("United States 2016 Presidential Election, 1% reporting.")
23
+ expect(replies[1]).to eq("Hillary Clinton: 0.0%, 0 electoral votes. WINNER! ")
24
+ expect(replies[2]).to eq("Donald Trump: 0.0%, 0 electoral votes.")
23
25
  end
24
26
 
25
27
  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.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps