Created
September 6, 2013 21:03
-
-
Save eric/6470015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe :child_watcher_behavior do | |
describe :async_watch, :async => true do | |
it_should_behave_like "all success return values" | |
before do | |
@watcher = Zookeeper::Callbacks::WatcherCallback.new | |
@cb = Zookeeper::Callbacks::StringsCallback.new | |
@rv = zk.get_children(:path => path, :watcher => @watcher, :watcher_context => path, :callback => @cb, :callback_context => path) | |
wait_until { @cb.completed? } | |
@cb.should be_completed | |
end | |
it %[should fire the watcher when the node has been deleted] do | |
@watcher.should_not be_completed | |
zk.delete(:path => path)[:rc].should == Zookeeper::ZOK | |
wait_until { @watcher.completed? } | |
@watcher.should be_completed | |
@watcher.path.should == path | |
@watcher.context.should == path | |
@watcher.type.should == Zookeeper::ZOO_DELETED_EVENT | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment