spec/inputs/rss_spec.rb in logstash-input-rss-3.0.5 vs spec/inputs/rss_spec.rb in logstash-input-rss-3.0.6
- old
+ new
@@ -1,7 +1,8 @@
# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
+require "logstash/devutils/rspec/shared_examples"
require "logstash/inputs/rss"
require 'ostruct'
describe LogStash::Inputs::Rss do
describe "stopping" do
@@ -100,8 +101,24 @@
end
describe "atom feed" do
let(:fixtures_source) { File.join(File.dirname(__FILE__), "..", "fixtures", "atom") }
it_behaves_like "fetching data"
+ end
+
+ private
+
+ # reinvented - has been deprecated in devutils 2.0
+ def plugin_input(plugin, &block)
+ queue = Queue.new
+
+ input_thread = Thread.new do
+ plugin.run(queue)
+ end
+ result = block.call(queue)
+
+ plugin.do_stop
+ input_thread.join
+ result
end
end