Sha256: 35eaa7fba27f47cadfae093def7bc8f2e6b16f2afc0644298e26d0e4db6ada48

Contents?: true

Size: 758 Bytes

Versions: 8

Compression:

Stored size: 758 Bytes

Contents

shared_examples_for 'node set' do
  let(:node_set){ Cellect::NodeSet.new }
  
  it 'should connect to zoo keeper' do
    expect(node_set.zk).to be_nil
    pass_until node_set, is: :ready
    expect(node_set.zk).to be_connected
  end
  
  it 'should know the connection state' do
    expect(node_set.state).to be :initializing
    pass_until node_set, is: :ready
    expect(node_set).to be_ready
  end
  
  it 'should accept a connection string' do
    url_before = ENV['ZK_URL']
    begin
      pass_until node_set, is: :ready
      ENV['ZK_URL'] = 'foobar'
      expect(node_set.send(:zk_url)).to eq 'foobar'
      ENV.delete 'ZK_URL'
      expect(node_set.send(:zk_url)).to eq 'localhost:2181'
    ensure
      ENV['ZK_URL'] = url_before
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
cellect-server-0.1.3 spec/support/shared_examples_for_node_set.rb
cellect-client-0.1.3 spec/support/shared_examples_for_node_set.rb
cellect-client-0.1.2.pre.jruby spec/support/shared_examples_for_node_set.rb
cellect-server-0.1.2.pre.jruby spec/support/shared_examples_for_node_set.rb
cellect-client-0.1.2 spec/support/shared_examples_for_node_set.rb
cellect-server-0.1.2 spec/support/shared_examples_for_node_set.rb
cellect-client-0.1.1 spec/support/shared_examples_for_node_set.rb
cellect-server-0.1.1 spec/support/shared_examples_for_node_set.rb