spec/etcdv3/lock_spec.rb in etcdv3-0.11.4 vs spec/etcdv3/lock_spec.rb in etcdv3-0.11.5
- old
+ new
@@ -8,16 +8,30 @@
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) }
+ it 'returns a response' do
+ lease_id = lease_stub.lease_grant(10)['ID']
+
+ expect(stub.lock('example1', lease_id)).to be_an_instance_of(V3lockpb::LockResponse)
+ end
+
+ it 'passes metadata correctly' do
+ lease_id = lease_stub.lease_grant(10)['ID']
+ stub = expect_metadata_passthrough(described_class, :lock, :lock)
+ stub.lock('example2', lease_id)
+ end
end
describe '#unlock' do
- subject { stub.unlock('foo') }
- it { is_expected.to be_an_instance_of(V3lockpb::UnlockResponse) }
+ it 'returns a response' do
+ expect(stub.unlock('example3')).to be_an_instance_of(V3lockpb::UnlockResponse)
+ end
+
+ it 'passes metadata correctly' do
+ stub = expect_metadata_passthrough(described_class, :unlock, :unlock)
+ stub.unlock('example4')
+ end
end
end
end