Class: MockEtcd::Client

Inherits:
Etcd::Client
  • Object
show all
Includes:
WebMock::API
Defined in:
lib/mock_etcd/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
17
# File 'lib/mock_etcd/client.rb', line 10

def initialize(opts = {})
  @index = 0
  @nodes = {}

  WebMock.disable_net_connect! allow_localhost: false

  super
end

Instance Attribute Details

#nodesObject (readonly)

Returns the value of attribute nodes.



8
9
10
# File 'lib/mock_etcd/client.rb', line 8

def nodes
  @nodes
end

Instance Method Details

#api_execute(path, method, options = {}) ⇒ Object



19
20
21
22
23
# File 'lib/mock_etcd/client.rb', line 19

def api_execute(path, method, options = {})
  stub_request! path, method, options

  super
end