diff --git a/spec/lib/listen/adapter/linux_spec.rb b/spec/lib/listen/adapter/linux_spec.rb index d87b65ff..34e542db 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) { {} } @@ -42,6 +46,10 @@ allow(config).to receive(:silencer).and_return(silencer) end + after do + subject.stop + end + it 'starts by calling watch with default events' do expect(fake_worker).to receive(:watch).with(*directories.map(&:to_s), *default_events) subject.start @@ -55,6 +63,7 @@ before do fake_worker = double(:fake_worker_for_inotify_limit_message) allow(fake_worker).to receive(:watch).and_raise(Errno::ENOSPC) + allow(fake_worker).to receive(:close) fake_notifier = double(:fake_notifier, new: fake_worker) stub_const('INotify::Notifier', fake_notifier)