Closed
Description
Found this behaviour while testing serialization and deserialization of messages via YAML.
The following spec fails (at least on master
and 2.6.4
)
context 'when body is not present' do
it 'should encode after deserializing' do
message = Mail::Message.new(
to: '[email protected]',
cc: '[email protected]',
bcc: '[email protected]',
subject: 'subject'
)
serialized = message.to_yaml
deserialized = Mail::Message.from_yaml(serialized)
expect{ deserialized.encoded }.not_to raise_error
end
end
The #from_yaml
method sets @body
directly, which after YAML serialization will contain an Array on parts
instead of a PartList
instance.
Is this a bug, or it's the expected behaviour (making the body mandatory) ?