Permalink
Browse files

Calling #to_s on a field with a nil value returns an empty string ins…

…tead of nil


Fixes #194
  • Loading branch information...
1 parent 80ccb5f commit 83b97d2076f53b818373816892c6563927dc45cc @jeremy jeremy committed Jan 27, 2013
Showing with 3 additions and 2 deletions.
  1. +1 −0 CHANGELOG.rdoc
  2. +1 −1 lib/mail/fields/common/common_field.rb
  3. +1 −1 spec/mail/fields/unstructured_field_spec.rb
View
@@ -11,6 +11,7 @@ Performance:
* Close pull request 488 - Speed up field construction & comparison (bpot)
Bugs:
+* Calling #to_s on a field with a nil value returns an empty string instead of nil (jeremy)
* The Received header may contain zero name/value pairs, qmail-style (jeremy)
* Fix that setting an attachment with a :mime_type and :encoding would override the :encoding (jeremy)
* Fix that declaring an html_part but no text_part would use multipart/alternative anyway (jeremy)
@@ -22,7 +22,7 @@ def value
end
def to_s
- decoded
+ decoded.to_s
end
def default
@@ -43,7 +43,7 @@
it "should return '' on to_s if there is no value" do
@field.value = nil
- @field.encoded.should eq ''
+ @field.to_s.should eq ''
end
it "should give an encoded value ready to insert into an email" do

0 comments on commit 83b97d2

Please sign in to comment.