Skip to content

Commit d2e3898

Browse files
committed
fix tests
1 parent 07087ee commit d2e3898

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/logstash/inputs/elasticsearch/aggregation.rb

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def initialize(client, plugin)
1212
@client = client
1313
@plugin_params = plugin.params
1414

15+
@index = @plugin_params["index"]
1516
@size = @plugin_params["size"]
1617
@retries = @plugin_params["retries"]
1718
@plugin = plugin

spec/inputs/elasticsearch_spec.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ def wait_receive_request
11511151

11521152
context "when there's an exception" do
11531153
before(:each) do
1154-
allow(client).to receive(:search).and_raise RuntimeError
1154+
allow(client).to receive(:search).and_raise RuntimeError.new("test exception")
11551155
end
11561156
it 'produces no events' do
11571157
plugin.run queue
@@ -1296,6 +1296,10 @@ def wait_receive_request
12961296

12971297
let(:mock_queue) { double('queue', :<< => nil) }
12981298

1299+
before(:each) do
1300+
plugin.send(:setup_cursor_tracker)
1301+
end
1302+
12991303
it 'pushes a generated event to the queue' do
13001304
plugin.send(:push_hit, hit, mock_queue)
13011305
expect(mock_queue).to have_received(:<<) do |event|

0 commit comments

Comments
 (0)