Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Output message for OutputProcessor errors

instead of just an empty string. This should happen almost never, but
hopefully this will prompt people to report bugs if it does happen
instead of hiding them.
  • Loading branch information...
commit 7c60a0116032375916e94f6d82623155226353ac 1 parent 193e466
@presidentbeef authored
View
2  lib/brakeman/processors/output_processor.rb
@@ -10,7 +10,7 @@ class Brakeman::OutputProcessor < Ruby2Ruby
#Copies +exp+ and then formats it.
def format exp
- process(exp.deep_clone) || ""
+ process(exp.deep_clone) || "[Format Error]"
end
alias process_safely format
View
8 test/tests/test_output_processor.rb
@@ -6,19 +6,19 @@ def assert_output expected, original
end
def test_output_nil
- assert_output "", nil
+ assert_output "[Format Error]", nil
end
def test_output_empty_sexp
- assert_output "", Sexp.new
+ assert_output "[Format Error]", Sexp.new
end
def test_output_missing_node_type
- assert_output "", Sexp.new(Sexp.new(:str, 'x'))
+ assert_output "[Format Error]", Sexp.new(Sexp.new(:str, 'x'))
end
def test_output_bad_node_type
- assert_output "", Sexp.new(:bad_node_type)
+ assert_output "[Format Error]", Sexp.new(:bad_node_type)
end
def test_output_local_variable
Please sign in to comment.
Something went wrong with that request. Please try again.