summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 09:32:32 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 09:32:32 +0000
commit87acdae43dcfab5d28c85b10374be9faf6209076 (patch)
tree6e731ff9872d73900a67a9ac55aa04948dcf0ea2 /test/csv
parent3b77cb2a64315e5bb7b2eb9af08cbca5db434ce2 (diff)
Strip punctuation from CSV headers in symbol converter.
Patch by @cllns. [Fix GH-957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rwxr-xr-xtest/csv/test_headers.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/csv/test_headers.rb b/test/csv/test_headers.rb
index d8a1c15..5ec8932 100755
--- a/test/csv/test_headers.rb
+++ b/test/csv/test_headers.rb
@@ -225,6 +225,13 @@ class TestCSV::Headers < TestCSV
assert_equal([:one, :two_three], csv.headers)
end
+ def test_builtin_symbol_converter_with_punctuation
+ csv = CSV.parse( "One, Two & Three ($)", headers: true,
+ return_headers: true,
+ header_converters: :symbol )
+ assert_equal([:one, :two_three], csv.headers)
+ end
+
def test_builtin_converters_with_blank_header
csv = CSV.parse( "one,,three", headers: true,
return_headers: true,