lib/cucumber/cli/main.rb in cucumber-0.3.92 vs lib/cucumber/cli/main.rb in cucumber-0.3.93

- old
+ new

@@ -38,11 +38,10 @@ if configuration.drb? begin return DRbClient.run(@args, @error_stream, @out_stream) rescue DRbClientError => e @error_stream.puts "WARNING: #{e.message} Running features locally:" - configuration.parse!(@args) end end step_mother.options = configuration.options # Feature files must be loaded before files are required. @@ -61,10 +60,13 @@ step_mother.scenarios(:passed).any? else step_mother.scenarios(:failed).any? || (configuration.strict? && step_mother.steps(:undefined).any?) end + rescue ProfilesNotDefinedError, YmlLoadError, ProfileNotFound => e + @error_stream.puts e.message + true end def load_plain_text_features features = Ast::Features.new @@ -134,16 +136,12 @@ end end def trap_interrupt trap('INT') do + exit!(1) if $cucumber_interrupted $cucumber_interrupted = true - STDERR.puts "Interrupted. Waiting for current step to finish." - STDERR.puts "Will suicide in 5 seconds if current step doesn't finish gracefully." - Thread.new do - sleep(5) - exit!(1) - end + STDERR.puts "\nExiting... Interrupt again to exit immediately." end end end end end