spec/stateful_spec.rb in yaml-write-stream-1.0.4 vs spec/stateful_spec.rb in yaml-write-stream-2.0.0
- old
+ new
@@ -29,10 +29,20 @@
stream_writer.write_element('abc')
stream_writer.write_map
stream_writer.write_key_value('def', 'ghi')
stream_writer.close
- expect(stream.string).to eq(utf8("- abc\n- def: ! \"ghi\"\n"))
+ expect(stream.string).to eq(utf8("- abc\n- def: \"ghi\"\n"))
+ expect(stream_writer).to be_closed
+ expect(stream).to be_closed
+ end
+
+ it 'dumps numbers without quotes and without non-specific (implicit) tag notation' do
+ stream_writer.write_map
+ stream_writer.write_key_value('abc', 7)
+ stream_writer.close
+
+ expect(stream.string).to eq(utf8("abc: 7\n"))
expect(stream_writer).to be_closed
expect(stream).to be_closed
end
it 'quotes empty strings' do