Sha256: cc068f28e758da8996d23db4c89db2e6c1a9b9601443b66080e32abda4e6ce96

Contents?: true

Size: 989 Bytes

Versions: 6

Compression:

Stored size: 989 Bytes

Contents

module Helpers
  module MetadataPassthrough
    include Connections

    def expect_metadata_passthrough(stub_class, method_name, expectation_target)
      metadata = { user: "foo", password: "bar" }
      handler = local_stub_with_metadata(stub_class, metadata: metadata, timeout: 1)
      inner_stub = handler.instance_variable_get("@stub")
      expect(inner_stub).to receive(expectation_target).with(anything, hash_including(metadata: metadata)).and_call_original
      return handler
    end

    def expect_metadata_passthrough_namespace(stub_class, method_name, expectation_target, namespace)
      metadata = { user: "foo", password: "bar" }
      handler = local_namespace_stub_with_metadata(stub_class, metadata: metadata, timeout: 1, namespace: namespace)
      inner_stub = handler.instance_variable_get("@stub")
      expect(inner_stub).to receive(expectation_target).with(anything, hash_including(metadata: metadata)).and_call_original
      return handler
    end
  end
end

Version data entries

6 entries across 6 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/helpers/metadata_passthrough.rb
etcdv3-0.11.6 spec/helpers/metadata_passthrough.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/etcdv3-0.11.5/spec/helpers/metadata_passthrough.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/etcdv3-0.11.5/spec/helpers/metadata_passthrough.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/etcdv3-0.11.5/spec/helpers/metadata_passthrough.rb
etcdv3-0.11.5 spec/helpers/metadata_passthrough.rb