Sha256: db9e2fe7febb38377775d1cec8fc52e6584d450ea9ce8a15fdc95b709cde13b1

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

# Encoding: utf-8

require 'spec_helper'

describe 'Etcd read only client' do

  let(:client) do
    Etcd.client
  end

  it 'should not allow write' do
    key = random_key
    expect do
      read_only_client.set(key, value: uuid.generate)
    end.to raise_error(Net::HTTPRetriableError)
  end

  it 'should allow reads' do
    key = random_key
    value = uuid.generate
    client.set(key, value: value)
    sleep 1
    expect(read_only_client.get(key).value).to eq(value)
  end

  it 'should allow watch' do
    key = random_key
    value = uuid.generate
    index = client.set(key, value: value).node.modified_index
    expect(read_only_client.watch(key, index: index).value).to eq(value)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
etcd-0.2.2 spec/etcd/read_only_client_spec.rb
etcd-0.2.1 spec/etcd/read_only_client_spec.rb
etcd-0.2.0.beta.1 spec/etcd/read_only_client_spec.rb