Skip to content

Commit 70b59da

Browse files
committed
Tests pass
1 parent 7f769fb commit 70b59da

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

elasticsearch-transport/lib/elasticsearch/transport/transport/http/manticore.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ def perform_request(method, path, params={}, body=nil)
112112
body = __convert_to_json(body) if body
113113
@pool.perform_request(method, path, params, body)
114114
end
115+
116+
def __close_connections
117+
@adapter.manticore.close
118+
end
115119
end
116120
end
117121
end

elasticsearch-transport/test/unit/transport_manticore_test.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ class Elasticsearch::Transport::Transport::HTTP::ManticoreTest < Test::Unit::Tes
6363

6464
transport = Manticore.new :hosts => [ { :host => 'localhost', :port => 8080 } ], :options => options
6565

66-
67-
transport.adapter.manticore.expects(:get).with("http://localhost:8080/", :headers => {"content-type" => "application/json"}).returns(::Elasticsearch::Transport::Transport::Response.new(200, nil))
66+
resp = mock()
67+
resp.stubs(:code).returns(200)
68+
resp.stubs(:read_body).returns(nil)
69+
resp.stubs(:headers).returns({})
70+
transport.adapter.manticore.expects(:get).with("http://localhost:8080/", :headers => {"content-type" => "application/json"}).returns(resp)
6871

6972

7073
response = transport.perform_request 'GET', '/', {}

0 commit comments

Comments
 (0)