|
110 | 110 |
|
111 | 111 | # We have to make sure we create a bunch of events
|
112 | 112 | # so we actually really try to stop the plugin.
|
113 |
| - # |
114 |
| - # rspec's `and_yield` allow you to define a fix amount of possible |
| 113 | + # |
| 114 | + # rspec's `and_yield` allow you to define a fix amount of possible |
115 | 115 | # yielded values and doesn't allow you to create infinite loop.
|
116 | 116 | # And since we are actually creating thread we need to make sure
|
117 | 117 | # we have enough work to keep the thread working until we kill it..
|
@@ -140,10 +140,11 @@ def poll(polling_options = {})
|
140 | 140 | let(:id_field) { "my_id_field" }
|
141 | 141 | let(:md5_field) { "my_md5_field" }
|
142 | 142 | let(:sent_timestamp_field) { "my_sent_timestamp_field" }
|
| 143 | + let(:user_attributes_field) { "my_user_attributes_field" } |
143 | 144 |
|
144 | 145 | let(:message) do
|
145 | 146 | double("message", :message_id => message_id, :md5_of_body => md5_of_body, :attributes => { LogStash::Inputs::SQS::SENT_TIMESTAMP => epoch_timestamp } )
|
146 |
| - end |
| 147 | + end |
147 | 148 |
|
148 | 149 | subject { input.add_sqs_data(event, message) }
|
149 | 150 |
|
@@ -198,7 +199,7 @@ def poll(polling_options = {})
|
198 | 199 | end
|
199 | 200 |
|
200 | 201 | context "receiving messages" do
|
201 |
| - before do |
| 202 | + before do |
202 | 203 | expect(subject).to receive(:poller).and_return(mock_sqs).at_least(:once)
|
203 | 204 | end
|
204 | 205 |
|
@@ -235,7 +236,7 @@ def poll(polling_options = {})
|
235 | 236 | it "retry to fetch messages" do
|
236 | 237 | # change the poller implementation to raise SQS errors.
|
237 | 238 | had_error = false
|
238 |
| - |
| 239 | + |
239 | 240 | # actually using the child of `Object` to do an expectation of `#sleep`
|
240 | 241 | expect(subject).to receive(:sleep).with(LogStash::Inputs::SQS::BACKOFF_SLEEP_TIME)
|
241 | 242 | expect(mock_sqs).to receive(:poll).with(anything()).at_most(2) do
|
|
0 commit comments