Module: GrpcMock::Api

Included in:
GrpcMock
Defined in:
lib/grpc_mock/api.rb

Instance Method Summary collapse

Instance Method Details

#allow_net_connect!Object



22
23
24
# File 'lib/grpc_mock/api.rb', line 22

def allow_net_connect!
  GrpcMock.config.allow_net_connect = true
end

#disable_net_connect!Object



18
19
20
# File 'lib/grpc_mock/api.rb', line 18

def disable_net_connect!
  GrpcMock.config.allow_net_connect = false
end

#request_including(values) ⇒ Object

Parameters:

  • values (Hash)


14
15
16
# File 'lib/grpc_mock/api.rb', line 14

def request_including(values)
  GrpcMock::Matchers::RequestIncludingMatcher.new(values)
end

#stub_request(path) ⇒ Object

Parameters:

  • path (String)


9
10
11
# File 'lib/grpc_mock/api.rb', line 9

def stub_request(path)
  GrpcMock.stub_registry.register_request_stub(GrpcMock::RequestStub.new(path))
end