Sha256: 33250bab3e4cd2539ddd6a4beccf16c296e3f8ceaa811308153124cbd6b4e7c0

Contents?: true

Size: 662 Bytes

Versions: 8

Compression:

Stored size: 662 Bytes

Contents

require 'spec_helper'
require 'securerandom'

# Locking is not implemented in etcd v3.1.X
unless $instance.version < Gem::Version.new("3.2.0")
  describe Etcdv3::Watch do
    let(:stub) { local_stub(Etcdv3::Watch, 5) }
    let(:kv_stub) { local_stub(Etcdv3::KV, 1) }

    context 'watch' do
      it 'should return an event' do 
        resp = nil
        thr = Thread.new do |thr|
          resp = stub.watch("foo", nil, 1, nil)
        end
        sleep 2
        kv_stub.put("foo", "works")
        thr.join
        expect(resp).to be_an_instance_of(Google::Protobuf::RepeatedField)
        expect(resp.last.kv.key).to eq('foo')  
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/etcdv3-0.11.5/spec/etcdv3/watch_spec.rb
etcdv3-0.11.6 spec/etcdv3/watch_spec.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/etcdv3-0.11.5/spec/etcdv3/watch_spec.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/etcdv3-0.11.5/spec/etcdv3/watch_spec.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/etcdv3-0.11.5/spec/etcdv3/watch_spec.rb
etcdv3-0.11.5 spec/etcdv3/watch_spec.rb
etcdv3-0.11.4 spec/etcdv3/watch_spec.rb
etcdv3-0.11.3 spec/etcdv3/watch_spec.rb