Skip to content

Commit

Permalink
Catch :task_has_failed on the cli. (Fixes #88)
Browse files Browse the repository at this point in the history
Since the server throws the Guard symbol :task_has_failed
to exit quickly, the cli wasn't catching it at all, leading to an
abrupt process termination and leaving the server running.

Now that :task_has_failed is catched, the cli runner tries to
run the specs anyway and terminates the server properly if
the runner is not available.
  • Loading branch information
netzpirat committed Nov 11, 2012
1 parent b9d8329 commit 00f6e3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/guard/jasmine/cli.rb
Expand Up @@ -123,7 +123,9 @@ def spec(*paths)
runner_options[:max_error_notify] = 0

if CLI.phantomjs_bin_valid?(runner_options[:phantomjs_bin])
::Guard::Jasmine::Server.start(runner_options) unless runner_options[:server] == :none
catch (:task_has_failed) do
::Guard::Jasmine::Server.start(runner_options) unless runner_options[:server] == :none
end

if CLI.runner_available?(runner_options)
result = ::Guard::Jasmine::Runner.run(paths, runner_options)
Expand Down

0 comments on commit 00f6e3b

Please sign in to comment.