spec/outputs/newrelic_spec.rb in logstash-output-newrelic-1.0.8 vs spec/outputs/newrelic_spec.rb in logstash-output-newrelic-1.0.9
- old
+ new
@@ -60,11 +60,13 @@
@newrelic_output = LogStash::Plugin.lookup("output", "newrelic").new(simple_config)
@newrelic_output.register
end
after(:each) do
- @newrelic_output&.shutdown
+ if @newrelic_output
+ @newrelic_output.shutdown
+ end
end
context "validation of config" do
it "requires api_key" do
no_api_key_config = {
@@ -198,11 +200,11 @@
@newrelic_output.multi_receive([])
# Shut down the plugin so that it has the chance to send a request
# (since we're verifying that nothing is sent)
- @newrelic_output&.shutdown
+ @newrelic_output.shutdown
expect(a_request(:post, base_uri))
.not_to have_been_made
end
@@ -231,10 +233,10 @@
specific_config["max_delay"] = 60
specific_config["retry_seconds"] = 5
# Create a new plugin with this specific config that has longer retry sleep
# configuration than we normally want
- @newrelic_output&.shutdown
+ @newrelic_output.shutdown
@newrelic_output = LogStash::Plugin.lookup("output", "newrelic").new(specific_config)
@newrelic_output.register
expect(@newrelic_output.sleep_duration(0)).to equal(0)
expect(@newrelic_output.sleep_duration(1)).to equal(5)