spec/stateful_spec.rb in yaml-write-stream-2.0.0 vs spec/stateful_spec.rb in yaml-write-stream-2.0.1
- old
+ new
@@ -63,9 +63,17 @@
expect(stream.string).to eq(utf8("foo: \n"))
expect(stream_writer).to be_closed
expect(stream).to be_closed
end
+
+ it 'quotes numeric string keys' do
+ stream_writer.write_map
+ stream_writer.write_key_value('110', 'foo')
+ stream_writer.close
+
+ expect(stream.string).to eq(utf8("\"110\": \"foo\"\n"))
+ end
end
describe '#closed?' do
it 'returns false if the stream is still open' do
expect(stream_writer).to_not be_closed