Skip to content

Commit

Permalink
New bars less reds
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Nov 9, 2016
1 parent 269aa74 commit b23788a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/lita/handlers/onewheel_election_cnn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def election(response)
(50 - bluecount - redcount).times { blueredstr += '-' }
blueredstr += "\x0304"
redcount.times { blueredstr += '█' }
response.reply "Clinton #{votes['blue']['percentage']}% #{votes['blue']['popular']} |#{blueredstr}| Trump #{votes['blue']['percentage']}% #{votes['blue']['popular']}"
response.reply "Clinton #{votes['blue']['percentage']}% #{votes['blue']['popular']} |#{blueredstr}\x0300| Trump #{votes['blue']['percentage']}% #{votes['blue']['popular']}"
end

def election_by_state(response)
Expand Down
2 changes: 1 addition & 1 deletion lita-onewheel-election-cnn.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = 'lita-onewheel-election-cnn'
spec.version = '4.0.0'
spec.version = '4.0.1'
spec.authors = ['Andrew Kreps']
spec.email = ['andrew.kreps@gmail.com']
spec.description = %q{Lita interface to CNN's 2016 Presidential Election JSON.}
Expand Down
4 changes: 2 additions & 2 deletions spec/lita/handlers/onewheel_election_cnn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
allow(RestClient).to receive(:get) { mock }
send_command 'election'
expect(replies[0]).to eq("United States 2016 Presidential Election, 1% reporting.")
expect(replies[1]).to eq("Clinton 0.0% 0 |\u000312\u000300--------------------------------------------------\u000304| Trump 0.0% 0")
expect(replies[1]).to eq("Clinton 0.0% 0 |\u000312\u000300--------------------------------------------------\u000304\u000300| Trump 0.0% 0")
end

it 'shows a winner' do
mock = File.open('spec/fixtures/winner.json').read
allow(RestClient).to receive(:get) { mock }
send_command 'election'
expect(replies[0]).to eq("United States 2016 Presidential Election, 1% reporting.")
expect(replies[1]).to eq("Clinton 0.0% 0 |\u000312\u000300--------------------------------------------------\u000304| Trump 0.0% 0")
expect(replies[1]).to eq("Clinton 0.0% 0 |\u000312\u000300--------------------------------------------------\u000304\u000300| Trump 0.0% 0")
end

it 'shows by state' do
Expand Down

0 comments on commit b23788a

Please sign in to comment.