spec/inputs/snmp_spec.rb in logstash-input-snmp-1.2.3 vs spec/inputs/snmp_spec.rb in logstash-input-snmp-1.2.4
- old
+ new
@@ -13,10 +13,12 @@
}}
before do
expect(LogStash::SnmpClient).to receive(:new).and_return(mock_client)
expect(mock_client).to receive(:get).and_return({})
+ # devutils in v6 calls close on the test pipelines while it does not in v7+
+ expect(mock_client).to receive(:close).at_most(:once)
end
end
context "OIDs options validation" do
let(:valid_configs) {
@@ -126,9 +128,11 @@
context "@metadata" do
before do
expect(LogStash::SnmpClient).to receive(:new).and_return(mock_client)
expect(mock_client).to receive(:get).and_return({"foo" => "bar"})
+ # devutils in v6 calls close on the test pipelines while it does not in v7+
+ expect(mock_client).to receive(:close).at_most(:once)
end
it "shoud add @metadata fields and add default host field" do
config = <<-CONFIG
input {