summaryrefslogtreecommitdiff
path: root/test/psych/test_set.rb
diff options
context:
space:
mode:
authorRobert Schulze <robert@dotless.de>2023-02-23 13:38:54 +0100
committergit <svn-admin@ruby-lang.org>2024-01-18 17:32:34 +0000
commitd3b07b984545ce156e02e9f71404b652c6cb5284 (patch)
treedb319e0f29d7719d4d19ac4722ad09b049cf351b /test/psych/test_set.rb
parent00814fd6724fff66a10966f5be10ea6dae06c616 (diff)
[ruby/psych] Add :stringify_names option to convert symbol keys to string for dumping
https://github.com/ruby/psych/commit/3d051d89aa
Diffstat (limited to 'test/psych/test_set.rb')
-rw-r--r--test/psych/test_set.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/psych/test_set.rb b/test/psych/test_set.rb
index 87944d839e..b4968d3425 100644
--- a/test/psych/test_set.rb
+++ b/test/psych/test_set.rb
@@ -46,5 +46,12 @@ bar: baz
@set['self'] = @set
assert_cycle(@set)
end
+
+ def test_stringify_names
+ @set[:symbol] = :value
+
+ assert_match(/^:symbol: :value/, Psych.dump(@set))
+ assert_match(/^symbol: :value/, Psych.dump(@set, stringify_names: true))
+ end
end
end