Skip to content

Commit

Permalink
issue guard#533: subject.stop so thread cannot keep running and lead …
Browse files Browse the repository at this point in the history
…to raise_expired_test_double_error
  • Loading branch information
ColinDKelley committed Mar 21, 2021
1 parent c24d860 commit 82e7bc2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/lib/listen/adapter/linux_spec.rb
Expand Up @@ -26,6 +26,10 @@
# TODO: fix other adapters too!
subject { described_class.new(config) }

after do
subject.stop
end

describe 'watch events' do
let(:directories) { [Pathname.pwd] }
let(:adapter_options) { {} }
Expand All @@ -40,6 +44,11 @@
allow(config).to receive(:adapter_options).and_return(adapter_options)
allow(config).to receive(:queue).and_return(queue)
allow(config).to receive(:silencer).and_return(silencer)
allow(fake_worker).to receive(:close)
end

after do
subject.stop
end

it 'starts by calling watch with default events' do
Expand Down Expand Up @@ -168,7 +177,6 @@
end

it 'stops the worker' do
expect(fake_worker).to receive(:close)
subject.stop
end
end
Expand Down

0 comments on commit 82e7bc2

Please sign in to comment.