lita-onewheel-election-cnn 2.0.0 → 3.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: a230237c43d961c274327d58c8aeae5e1ea8614c
4
- data.tar.gz: af185e979ca24f2d89a5e17fe9aaf30801769cfd
3
+ metadata.gz: 30c1898cee0d74d869a5e8d86c48fdf1fca41332
4
+ data.tar.gz: 428326960b2d5eb2bbf537605fb79492cae926d9
5
5
  SHA512:
6
- metadata.gz: f6a5135d0c3ab115acafe76ad9783b762087bde501b30ea64d1011327d1deae799fd3630fdf4a8646d9de1e72ec385803840768631c6b1ed7bb141471617cc75
7
- data.tar.gz: d0d2f7e97441f2738486bb0eaf05efc3d770538b029621b93db07bc5957f30dd09f3bceacdee8cf5cff8929771a8fd90483b35665729b3096fc3eaf6db6b8893
6
+ metadata.gz: c397ead8761546a44341bd7b1b780020fb43b54b4a8474989ea5f068cf85ce06a38b7cb0569cf1b1b57186f3ebd0fbcdb87db50b8657225d1e18234ce5664a24
7
+ data.tar.gz: 1588204b29a442effaf07966d39df58355f4743e35708a8f9310447ef680974ec219c6ddbb6bf808e6a3f4b641e0266c41aece56f6a6b15725f24f2c5c508c90
@@ -33,8 +33,9 @@ module Lita
33
33
 
34
34
  results['races'].each do |race|
35
35
  if race['state'].downcase == state.downcase
36
+ response.reply "#{state}, #{race['evotes']} electoral votes, #{race['pctsrep']}% reporting"
36
37
  race['candidates'].each do |candidate|
37
- candidate_str = "#{state} (#{race['evotes']} electoral votes) - #{candidate['fname']} #{candidate['lname']}: "
38
+ candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
38
39
  candidate_str += "#{candidate['pctDecimal']}%"
39
40
  candidate_str += " WINNER! #{candidate['evotes']} electoral votes." if candidate['winner']
40
41
  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 = '2.0.0'
3
+ spec.version = '3.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,26 @@ 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 (13 electoral votes) - Hillary Clinton: 0.0%")
27
- expect(replies[1]).to eq("Virginia (13 electoral votes) - Donald Trump: 0.0%")
26
+ expect(replies[0]).to eq("Virginia, 13 electoral votes, 0% reporting")
27
+ expect(replies[1]).to eq("Hillary Clinton: 0.0%")
28
+ expect(replies[2]).to eq("Donald Trump: 0.0%")
28
29
  end
29
30
 
30
31
  it 'shows by STATE' do
31
32
  mock = File.open('spec/fixtures/election.json').read
32
33
  allow(RestClient).to receive(:get) { mock }
33
34
  send_command 'election VA'
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%")
35
+ expect(replies[0]).to eq("Virginia, 13 electoral votes, 0% reporting")
36
+ expect(replies[1]).to eq("Hillary Clinton: 0.0%")
37
+ expect(replies[2]).to eq("Donald Trump: 0.0%")
36
38
  end
37
39
 
38
40
  it 'shows by full state name downcase' do
39
41
  mock = File.open('spec/fixtures/election.json').read
40
42
  allow(RestClient).to receive(:get) { mock }
41
43
  send_command 'election new york'
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
+ expect(replies[0]).to eq("NEW YORK, 29 electoral votes, 0% reporting")
45
+ expect(replies[1]).to eq("Hillary Clinton: 0.0%")
46
+ expect(replies[2]).to eq("Donald Trump: 0.0%")
44
47
  end
45
48
  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: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps