Skip to content

Commit

Permalink
Ok, 1.8.7, you're annoying me now. Fix for stray node creation in spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
slyphon committed Apr 23, 2012
1 parent 1414332 commit 6c0c9e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion spec/z_k/client/multiplexed_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
require 'shared/client_examples'

describe 'ZK::Client::Multiplexed', :client => :multiplexed do
before do
Expand Down
1 change: 0 additions & 1 deletion spec/z_k/client_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
require 'shared/client_examples'

describe ZK::Client::Threaded do
include_context 'threaded client connection'
Expand Down
23 changes: 12 additions & 11 deletions spec/z_k/election_spec.rb
Expand Up @@ -162,21 +162,22 @@
@obama.zk.close!
wait_until { @palin_won }

zk = ZK.new('localhost:2181')
newbama = ZK::Election::Candidate.new(zk, @election_name, :data => @data1)
ZK.open('localhost:2181') do |zk|
newbama = ZK::Election::Candidate.new(zk, @election_name, :data => @data1)

win_again = false
win_again = false

newbama.on_winning_election do
win_again = true
end
newbama.on_winning_election do
win_again = true
end

newbama.vote!
wait_until { newbama.voted? }
newbama.vote!
wait_until { newbama.voted? }

newbama.should be_voted
win_again.should be_false
newbama.should_not be_leader
newbama.should be_voted
win_again.should be_false
newbama.should_not be_leader
end
end
end
end
Expand Down

0 comments on commit 6c0c9e6

Please sign in to comment.