passing specs for watcher exception handling

This commit is contained in:
Julio Capote 2011-06-23 08:52:02 -07:00
parent 8e91b5f737
commit 05e55545b7

View File

@ -143,8 +143,13 @@ describe Guard::Watcher do
context "with an exception that is raised" do context "with an exception that is raised" do
before(:all) { @guard.watchers = [Guard::Watcher.new('evil.rb', lambda { raise "EVIL" })] } before(:all) { @guard.watchers = [Guard::Watcher.new('evil.rb', lambda { raise "EVIL" })] }
it "displays the error" do it "displays the error and backtrace" do
Guard::UI.should_receive(:error).with("Problem with watch action!") Guard::UI.should_receive(:error) { |msg|
msg.should include("Problem with watch action!")
msg.should include("EVIL")
}
Guard::Watcher.match_files(@guard, ['evil.rb']) Guard::Watcher.match_files(@guard, ['evil.rb'])
end end
end end