From 05e55545b79bcb53231df20a5ce0d579e6fb381c Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Thu, 23 Jun 2011 08:52:02 -0700 Subject: [PATCH 1/2] passing specs for watcher exception handling --- spec/guard/watcher_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/guard/watcher_spec.rb b/spec/guard/watcher_spec.rb index a6dee99..f3521bc 100644 --- a/spec/guard/watcher_spec.rb +++ b/spec/guard/watcher_spec.rb @@ -143,8 +143,13 @@ describe Guard::Watcher do context "with an exception that is raised" do before(:all) { @guard.watchers = [Guard::Watcher.new('evil.rb', lambda { raise "EVIL" })] } - it "displays the error" do - Guard::UI.should_receive(:error).with("Problem with watch action!") + it "displays the error and backtrace" do + Guard::UI.should_receive(:error) { |msg| + msg.should include("Problem with watch action!") + msg.should include("EVIL") + + } + Guard::Watcher.match_files(@guard, ['evil.rb']) end end From 268d55a145b9448e3e00195e7aa26d4467f24f92 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Thu, 23 Jun 2011 08:54:27 -0700 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8220aa..1295a27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ## Improvements +- Pull request [#94](https://github.com/guard/guard/pull/94): Show backtrace in terminal when a problem with a watch action occurs. ([@capotej][]) - Pull request [#88](https://github.com/guard/guard/pull/88): Write exception trace in the terminal when a supervised task fail. ([@mcmire][]) - Color in red the "ERROR:" flag when using `UI.error`. ([@rymai][]) - Issue [#79](https://github.com/guard/guard/issues/79) and Pull request [#82](https://github.com/guard/guard/pull/82): Improve INotify support on Linux. ([@Gazer][] & [@yannlugrin][])