From 69245d96748d70efb009bc9aec4f245c904e3939 Mon Sep 17 00:00:00 2001 From: Yann Lugrin Date: Thu, 21 Oct 2010 16:35:25 +0800 Subject: [PATCH] listener spec work on every systems --- spec/guard/listener_spec.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/guard/listener_spec.rb b/spec/guard/listener_spec.rb index 430e426..abab55d 100644 --- a/spec/guard/listener_spec.rb +++ b/spec/guard/listener_spec.rb @@ -10,21 +10,24 @@ describe Guard::Listener do it "should use darwin listener on Mac OS X" do Config::CONFIG['target_os'] = 'darwin10.4.0' + Guard::Darwin.stub(:usable?).and_return(true) Guard::Darwin.should_receive(:new) subject.init end it "should use polling listener on Windows" do Config::CONFIG['target_os'] = 'win32' + Guard::Polling.stub(:usable?).and_return(true) Guard::Polling.should_receive(:new) subject.init end - # it "should use inotify_watch on Linux" do - # # Sys::Uname.stub(:sysname).and_return('Linux') - # IO.should_receive(:popen).with(/.*\/inotify_watch\s\./).and_return(pipe_mock) - # subject.start - # end + it "should use linux listener on Linux" do + Config::CONFIG['target_os'] = 'linux' + Guard::Linux.stub(:usable?).and_return(true) + Guard::Linux.should_receive(:new) + subject.init + end end