Skip to content

Commit

Permalink
Merge pull request #68 from theodi/include-col-name-in-message
Browse files Browse the repository at this point in the history
include column name in :header_name message
  • Loading branch information
ldodds committed Feb 18, 2014
2 parents 0092995 + 53b174a commit d961b3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/csvlint/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def initialize(uri, fields=[], title=nil, description=nil)
def validate_header(header)
reset
header.each_with_index do |name,i|
build_warnings(:header_name, :schema, nil, i+1) if fields[i].name != name
build_warnings(:header_name, :schema, nil, i+1, name) if fields[i].name != name
end
return valid?
end
Expand Down
1 change: 1 addition & 0 deletions spec/schema_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
expect( schema.validate_header(["wrong", "required"]) ).to eql(true)
expect( schema.warnings.size ).to eql(1)
expect( schema.warnings.first.type).to eql(:header_name)
expect( schema.warnings.first.content).to eql("wrong")
expect( schema.warnings.first.category).to eql(:schema)

expect( schema.validate_header(["minimum", "Required"]) ).to eql(true)
Expand Down

0 comments on commit d961b3e

Please sign in to comment.