Sha256: 118f789bde784b55fa8c2681fff93faeeeb5d017c1ddd245dfb553096d6c2e5e

Contents?: true

Size: 841 Bytes

Versions: 2

Compression:

Stored size: 841 Bytes

Contents

require 'spec_helper'

# Locking is not implemented in etcd v3.1.X
unless $instance.version < Gem::Version.new("3.2.0")
  describe Etcdv3::Lock do
    let(:stub) { local_namespace_stub(Etcdv3::Namespace::Lock, 1, '/namespace/') }
    let(:lease_stub) { local_stub(Etcdv3::Lease, 1) }

    it_should_behave_like "a method with a GRPC timeout", described_class, :unlock, :unlock, 'foo'
    # it_should_behave_like "a method with a GRPC timeout", described_class, :lock, :lock, 'foo'

    describe '#lock' do
      let(:lease_id) { lease_stub.lease_grant(10)['ID'] }
      subject { stub.lock('foo', lease_id) }
      it { is_expected.to be_an_instance_of(V3lockpb::LockResponse) }
    end

    describe '#unlock' do
      subject { stub.unlock('foo') }
      it { is_expected.to be_an_instance_of(V3lockpb::UnlockResponse) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
etcdv3-0.11.4 spec/etcdv3/namespace/lock_spec.rb
etcdv3-0.11.3 spec/etcdv3/namespace/lock_spec.rb