diff --git a/spec/lib/listen/adapter/linux_spec.rb b/spec/lib/listen/adapter/linux_spec.rb index d87b65ff..13d2a257 100644 --- a/spec/lib/listen/adapter/linux_spec.rb +++ b/spec/lib/listen/adapter/linux_spec.rb @@ -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) { {} } @@ -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 @@ -168,7 +177,6 @@ end it 'stops the worker' do - expect(fake_worker).to receive(:close) subject.stop end end