Skip to content
Browse files

add cheezy run mode to ensure we raise rather than log during testing

  • Loading branch information...
1 parent 038489c commit e648135e16ad07cc3a24e20b6f017b3a05c7a20b @twcamper committed Jul 4, 2011
Showing with 7 additions and 3 deletions.
  1. +1 −0 features/support/env.rb
  2. +3 −2 lib/cuporter/feature_parser/parser_base.rb
  3. +3 −1 spec/spec_helper.rb
View
1 features/support/env.rb
@@ -1,5 +1,6 @@
$LOAD_PATH << File.expand_path('../../../lib' , __FILE__)
require 'cuporter'
+ENV['CUPORTER_MODE'] = 'test'
module Support
def doc
View
5 lib/cuporter/feature_parser/parser_base.rb
@@ -1,4 +1,4 @@
-# Copyright 2010 ThoughtWorks, Inc. Licensed under the MIT License
+# Copyright 2011 ThoughtWorks, Inc. Licensed under the MIT License
module Cuporter
module FeatureParser
@@ -24,7 +24,8 @@ def parse_feature
begin
handle_lines
rescue Exception => ex
- Cuporter.log_error(ex, "Error parsing file", "at line #{@line_no}:", @file,
+ raise if ENV['CUPORTER_MODE'] =~ /^test$/i
+ Cuporter.log_error(ex, "Error parsing file", "at line #{@line_no}:", @file,
%Q{\n\tIf this file can be run by Cucumber with no Gherkin lexing or parsing errors,
please submit a bug ticket @ github including: 1) this feature file or its contents, and 2) this stack trace.
})
View
4 spec/spec_helper.rb
@@ -4,7 +4,9 @@
require 'config/configuration'
Dir["spec/cuporter/support/**/*.rb"].each { |lib| require lib }
-RSpec.configure do |config|
+ENV['CUPORTER_MODE'] = 'test'
+
+RSpec.configure do |config|
config.include(Spec::Functional::Cli)
end

0 comments on commit e648135

Please sign in to comment.
Something went wrong with that request. Please try again.