Skip to content

Commit

Permalink
move thread abort_on_exception setting to before(:all) and after(:all)
Browse files Browse the repository at this point in the history
  • Loading branch information
guyboertje authored and jordansissel committed Dec 3, 2015
1 parent 011f80f commit 9e9d3c6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions spec/inputs/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
require "stud/temporary"
require "logstash/inputs/file"

Thread.abort_on_exception = true

FILE_DELIMITER = LogStash::Environment.windows? ? "\r\n" : "\n"

describe LogStash::Inputs::File do

before(:all) do
@abort_on_exception = Thread.abort_on_exception
Thread.abort_on_exception = true
end

after(:all) do
Thread.abort_on_exception = @abort_on_exception
end

it_behaves_like "an interruptible input plugin" do
let(:config) do
{
Expand Down Expand Up @@ -192,7 +199,7 @@
end
end

context "when #run is called multiple times" do
context "when #run is called multiple times", :unix => true do
let(:tmpdir_path) { Stud::Temporary.directory }
let(:sincedb_path) { Stud::Temporary.pathname }
let(:file_path) { "#{tmpdir_path}/a.log" }
Expand Down

0 comments on commit 9e9d3c6

Please sign in to comment.