From 8ace079731196f66529334a422a3c040b40a13a3 Mon Sep 17 00:00:00 2001 From: Harry Lascelles Date: Sat, 28 Jul 2012 12:39:31 +0100 Subject: [PATCH] Expanded switch statement --- lib/jasmine/headless/task.rb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/jasmine/headless/task.rb b/lib/jasmine/headless/task.rb index 058a33c..23b5f4c 100644 --- a/lib/jasmine/headless/task.rb +++ b/lib/jasmine/headless/task.rb @@ -18,15 +18,19 @@ module Jasmine private def run_rake_task - case Jasmine::Headless::Runner.run( - :colors => colors, - :remove_html_file => !@keep_on_error, - :jasmine_config => @jasmine_config - ) - when 1 - raise Jasmine::Headless::TestFailure - when 2 - raise Jasmine::Headless::ConsoleLogUsage + result = Jasmine::Headless::Runner.run( + :colors => colors, + :remove_html_file => !@keep_on_error, + :jasmine_config => @jasmine_config + ) + case result + when 1 + raise Jasmine::Headless::TestFailure + when 2 + raise Jasmine::Headless::ConsoleLogUsage + else + p "Unexpected Jasmine::Headless error code #{result}" + raise Jasmine::Headless::TestFailure end end end