Sha256: fc9f72efd9d5786320c6e7d2bb6216122bb33513d4669c1b59c1ee24a20a1125

Contents?: true

Size: 804 Bytes

Versions: 5

Compression:

Stored size: 804 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_stub(Etcdv3::Lock, 1) }
    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

5 entries across 5 versions & 1 rubygems

Version Path
etcdv3-0.11.4 spec/etcdv3/lock_spec.rb
etcdv3-0.11.3 spec/etcdv3/lock_spec.rb
etcdv3-0.10.2 spec/etcdv3/lock_spec.rb
etcdv3-0.10.1 spec/etcdv3/lock_spec.rb
etcdv3-0.9.0 spec/etcdv3/lock_spec.rb