Skip to content

Commit

Permalink
Option for all_errors to be empty array
Browse files Browse the repository at this point in the history
Fixes previously failing tests.
  • Loading branch information
bcouston committed Jul 21, 2015
1 parent 417906a commit 3c2cfe0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/csvlint/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(name, constraints={}, title=nil, description=nil)
reset
end

def validate_column(value, row=nil, column=nil, all_errors)
def validate_column(value, row=nil, column=nil, all_errors=[])
reset
unless all_errors.any?{|error| ((error.type == :invalid_regex) && (error.column == column))}
validate_regex(value, row, column)
Expand Down
2 changes: 1 addition & 1 deletion lib/csvlint/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def validate_header(header)
return valid?
end

def validate_row(values, row=nil, all_errors)
def validate_row(values, row=nil, all_errors=[])
reset
if values.length < fields.length
fields[values.size..-1].each_with_index do |field, i|
Expand Down

0 comments on commit 3c2cfe0

Please sign in to comment.