diff options
author | Robert Schulze <robert@dotless.de> | 2023-02-23 13:38:54 +0100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-01-18 17:32:34 +0000 |
commit | d3b07b984545ce156e02e9f71404b652c6cb5284 (patch) | |
tree | db319e0f29d7719d4d19ac4722ad09b049cf351b /test/psych/test_set.rb | |
parent | 00814fd6724fff66a10966f5be10ea6dae06c616 (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.rb | 7 |
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 |