Permalink
Browse files

Fix warning "useless use of == in void context"

  • Loading branch information...
1 parent abe4879 commit 650596f42df15e52486e1834f0f2bef939cec5ac Jason Stirk committed Jan 14, 2012
Showing with 1,767 additions and 1,767 deletions.
  1. +39 −39 spec/mail/attachments_list_spec.rb
  2. +63 −63 spec/mail/body_spec.rb
  3. +10 −10 spec/mail/configuration_spec.rb
  4. +14 −14 spec/mail/core_extensions/string_spec.rb
  5. +11 −11 spec/mail/core_extensions_spec.rb
  6. +18 −18 spec/mail/elements/address_list_spec.rb
  7. +33 −33 spec/mail/elements/address_spec.rb
  8. +2 −2 spec/mail/elements/envelope_from_element_spec.rb
  9. +3 −3 spec/mail/elements/message_ids_element_spec.rb
  10. +2 −2 spec/mail/elements/received_element_spec.rb
  11. +20 −20 spec/mail/encoding_spec.rb
  12. +4 −4 spec/mail/encodings/base64_spec.rb
  13. +4 −4 spec/mail/encodings/quoted_printable_spec.rb
  14. +86 −86 spec/mail/encodings_spec.rb
  15. +83 −83 spec/mail/example_emails_spec.rb
  16. +6 −6 spec/mail/field_list_spec.rb
  17. +42 −42 spec/mail/field_spec.rb
  18. +13 −13 spec/mail/fields/bcc_field_spec.rb
  19. +14 −14 spec/mail/fields/cc_field_spec.rb
  20. +4 −4 spec/mail/fields/comments_field_spec.rb
  21. +4 −4 spec/mail/fields/common/address_container_spec.rb
  22. +25 −25 spec/mail/fields/common/common_address_spec.rb
  23. +3 −3 spec/mail/fields/common/common_date_spec.rb
  24. +11 −11 spec/mail/fields/common/common_field_spec.rb
  25. +4 −4 spec/mail/fields/common/common_message_id_spec.rb
  26. +14 −14 spec/mail/fields/common/parameter_hash_spec.rb
  27. +4 −4 spec/mail/fields/content_description_field_spec.rb
  28. +13 −13 spec/mail/fields/content_disposition_field_spec.rb
  29. +17 −17 spec/mail/fields/content_id_field_spec.rb
  30. +7 −7 spec/mail/fields/content_location_field_spec.rb
  31. +13 −13 spec/mail/fields/content_transfer_encoding_field_spec.rb
  32. +223 −223 spec/mail/fields/content_type_field_spec.rb
  33. +11 −11 spec/mail/fields/date_field_spec.rb
  34. +3 −3 spec/mail/fields/envelope_spec.rb
  35. +18 −18 spec/mail/fields/from_field_spec.rb
  36. +14 −14 spec/mail/fields/in_reply_to_field_spec.rb
  37. +11 −11 spec/mail/fields/keywords_field_spec.rb
  38. +18 −18 spec/mail/fields/message_id_field_spec.rb
  39. +15 −15 spec/mail/fields/mime_version_field_spec.rb
  40. +14 −14 spec/mail/fields/received_field_spec.rb
  41. +13 −13 spec/mail/fields/references_field_spec.rb
  42. +12 −12 spec/mail/fields/reply_to_field_spec.rb
  43. +12 −12 spec/mail/fields/resent_bcc_field_spec.rb
  44. +12 −12 spec/mail/fields/resent_cc_field_spec.rb
  45. +9 −9 spec/mail/fields/resent_date_field_spec.rb
  46. +12 −12 spec/mail/fields/resent_from_field_spec.rb
  47. +6 −6 spec/mail/fields/resent_message_id_field_spec.rb
  48. +8 −8 spec/mail/fields/resent_sender_field_spec.rb
  49. +12 −12 spec/mail/fields/resent_to_field_spec.rb
  50. +5 −5 spec/mail/fields/return_path_field_spec.rb
  51. +8 −8 spec/mail/fields/sender_field_spec.rb
  52. +8 −8 spec/mail/fields/structured_field_spec.rb
  53. +16 −16 spec/mail/fields/to_field_spec.rb
  54. +24 −24 spec/mail/fields/unstructured_field_spec.rb
  55. +97 −97 spec/mail/header_spec.rb
  56. +7 −7 spec/mail/mail_spec.rb
  57. +303 −303 spec/mail/message_spec.rb
  58. +78 −78 spec/mail/mime_messages_spec.rb
  59. +10 −10 spec/mail/multipart_report_spec.rb
  60. +3 −3 spec/mail/network/delivery_methods/file_delivery_spec.rb
  61. +4 −4 spec/mail/network/delivery_methods/smtp_connection_spec.rb
  62. +10 −10 spec/mail/network/delivery_methods/smtp_spec.rb
  63. +3 −3 spec/mail/network/delivery_methods/test_mailer_spec.rb
  64. +34 −34 spec/mail/network/retriever_methods/imap_spec.rb
  65. +23 −23 spec/mail/network/retriever_methods/pop3_spec.rb
  66. +15 −15 spec/mail/network/retriever_methods/test_retriever_spec.rb
  67. +32 −32 spec/mail/network_spec.rb
  68. +8 −8 spec/mail/parsers/content_transfer_encoding_parser_spec.rb
  69. +11 −11 spec/mail/part_spec.rb
  70. +1 −1 spec/mail/parts_list_spec.rb
  71. +9 −9 spec/mail/round_tripping_spec.rb
  72. +49 −49 spec/mail/utilities_spec.rb
@@ -8,9 +8,9 @@ def encode_base64(str)
def check_decoded(actual, expected)
if RUBY_VERSION >= '1.9'
- actual.should == expected.force_encoding(Encoding::BINARY)
+ actual.should eq expected.force_encoding(Encoding::BINARY)
else
- actual.should == expected
+ actual.should eq expected
end
end
@@ -24,58 +24,58 @@ def check_decoded(actual, expected)
it "should work" do
file_data = File.read(filename = fixture('attachments', 'test.png'))
@mail.attachments['test.png'] = File.read(fixture('attachments', 'test.png'))
- @mail.attachments['test.png'].filename.should == 'test.png'
+ @mail.attachments['test.png'].filename.should eq 'test.png'
check_decoded(@mail.attachments[0].decoded, file_data)
end
it "should work out magically the mime_type" do
file_data = File.read(filename = fixture('attachments', 'test.png'))
@mail.attachments['test.png'] = File.read(fixture('attachments', 'test.png'))
- @mail.attachments[0].mime_type.should == 'image/png'
+ @mail.attachments[0].mime_type.should eq 'image/png'
end
it "should assign the filename" do
file_data = File.read(filename = fixture('attachments', 'test.png'))
@mail.attachments['test.png'] = file_data
- @mail.attachments[0].filename.should == 'test.png'
+ @mail.attachments[0].filename.should eq 'test.png'
end
it "should assign mime-encoded multibyte filename" do
file_data = File.read(filename = fixture('attachments', 'てすと.txt'))
@mail.attachments['てすと.txt'] = file_data
@mail.attachments.should_not be_blank
- Mail::Encodings.decode_encode(@mail.attachments[0].filename, :decode).should == 'てすと.txt'
+ Mail::Encodings.decode_encode(@mail.attachments[0].filename, :decode).should eq 'てすと.txt'
end
end
describe "from a supplied Hash" do
it "should work" do
file_data = File.read(filename = fixture('attachments', 'test.png'))
@mail.attachments['test.png'] = { :content => file_data }
- @mail.attachments[0].filename.should == 'test.png'
+ @mail.attachments[0].filename.should eq 'test.png'
check_decoded(@mail.attachments[0].decoded, file_data)
end
it "should allow you to override the content_type" do
file_data = File.read(filename = fixture('attachments', 'test.png'))
@mail.attachments['test.png'] = { :content => file_data,
:content_type => "application/x-gzip" }
- @mail.attachments[0].content_type.should == 'application/x-gzip'
+ @mail.attachments[0].content_type.should eq 'application/x-gzip'
end
it "should allow you to override the mime_type" do
file_data = File.read(filename = fixture('attachments', 'test.png'))
@mail.attachments['test.png'] = { :content => file_data,
:mime_type => "application/x-gzip" }
- @mail.attachments[0].mime_type.should == 'application/x-gzip'
+ @mail.attachments[0].mime_type.should eq 'application/x-gzip'
end
it "should allow you to override the mime_type" do
file_data = File.read(filename = fixture('attachments', 'test.png'))
@mail.attachments['invoice.jpg'] = { :data => "you smiling",
:mime_type => "image/x-jpg",
:transfer_encoding => "base64" }
- @mail.attachments[0].mime_type.should == 'image/x-jpg'
+ @mail.attachments[0].mime_type.should eq 'image/x-jpg'
end
end
@@ -86,7 +86,7 @@ def check_decoded(actual, expected)
file_data = File.read(filename = fixture('attachments', 'test.png'))
@mail.attachments['test.png'] = { :content => file_data }
@mail.ready_to_send!
- @mail.attachments[0].content_transfer_encoding.should == 'base64'
+ @mail.attachments[0].content_transfer_encoding.should eq 'base64'
end
it "should encode it's body to base64" do
@@ -119,7 +119,7 @@ def check_decoded(actual, expected)
else
expected = @mail.attachments[0].read
end
- expected.should == file_data
+ expected.should eq file_data
end
end
@@ -132,10 +132,10 @@ def check_decoded(actual, expected)
mail.attachments['test.gif'] = File.read(fixture('attachments', 'test.gif'))
mail.attachments['test.jpg'] = File.read(fixture('attachments', 'test.jpg'))
mail.attachments['test.zip'] = File.read(fixture('attachments', 'test.zip'))
- mail.attachments[0].filename.should == 'test.pdf'
- mail.attachments[1].filename.should == 'test.gif'
- mail.attachments[2].filename.should == 'test.jpg'
- mail.attachments[3].filename.should == 'test.zip'
+ mail.attachments[0].filename.should eq 'test.pdf'
+ mail.attachments[1].filename.should eq 'test.gif'
+ mail.attachments[2].filename.should eq 'test.jpg'
+ mail.attachments[3].filename.should eq 'test.zip'
end
end
@@ -145,15 +145,15 @@ def check_decoded(actual, expected)
it "should set the content_disposition to inline or attachment as appropriate" do
mail = Mail.new
mail.attachments['test.pdf'] = File.read(fixture('attachments', 'test.pdf'))
- mail.attachments['test.pdf'].content_disposition.should == 'attachment; filename=test.pdf'
+ mail.attachments['test.pdf'].content_disposition.should eq 'attachment; filename=test.pdf'
mail.attachments.inline['test.png'] = File.read(fixture('attachments', 'test.png'))
- mail.attachments.inline['test.png'].content_disposition.should == 'inline; filename=test.png'
+ mail.attachments.inline['test.png'].content_disposition.should eq 'inline; filename=test.png'
end
it "should return a cid" do
mail = Mail.new
mail.attachments.inline['test.png'] = File.read(fixture('attachments', 'test.png'))
- mail.attachments['test.png'].url.should == "cid:#{mail.attachments['test.png'].cid}"
+ mail.attachments['test.png'].url.should eq "cid:#{mail.attachments['test.png'].cid}"
end
it "should respond true to inline?" do
@@ -181,7 +181,7 @@ def check_decoded(actual, expected)
it "should provide a URL escaped content_id (without brackets) for use inside an email" do
@inline = @mail.attachments['test.gif'].cid
uri_parser = URI.const_defined?(:Parser) ? URI::Parser.new : URI
- @inline.should == uri_parser.escape(@cid.gsub(/^</, '').gsub(/>$/, ''))
+ @inline.should eq uri_parser.escape(@cid.gsub(/^</, '').gsub(/>$/, ''))
end
end
@@ -190,15 +190,15 @@ def check_decoded(actual, expected)
mail = Mail.new
mail.attachments['test.pdf'] = File.read(fixture('attachments', 'test.pdf'))
mail.encoded
- mail.mime_type.should == 'multipart/mixed'
+ mail.mime_type.should eq 'multipart/mixed'
end
end
describe "should handle filenames with non-7bit characters correctly" do
it "should not raise an exception with a filename that contains a non-7bit-character" do
filename = "f\u00f6\u00f6.b\u00e4r"
if RUBY_VERSION >= '1.9'
- filename.encoding.should == Encoding::UTF_8
+ filename.encoding.should eq Encoding::UTF_8
end
mail = Mail.new
doing {
@@ -214,42 +214,42 @@ def check_decoded(actual, expected)
it "should find the attachment using content location" do
mail = Mail.read(fixture(File.join('emails', 'attachment_emails', 'attachment_content_location.eml')))
- mail.attachments.length.should == 1
+ mail.attachments.length.should eq 1
end
it "should find an attachment defined with 'name' and Content-Disposition: attachment" do
mail = Mail.read(fixture(File.join('emails', 'attachment_emails', 'attachment_content_disposition.eml')))
- mail.attachments.length.should == 1
+ mail.attachments.length.should eq 1
end
it "should use the content-type filename or name over the content-disposition filename" do
mail = Mail.read(fixture(File.join('emails', 'attachment_emails', 'attachment_content_disposition.eml')))
- mail.attachments[0].filename.should == 'hello.rb'
+ mail.attachments[0].filename.should eq 'hello.rb'
end
it "should decode an attachment" do
mail = Mail.read(fixture(File.join('emails', 'attachment_emails', 'attachment_pdf.eml')))
- mail.attachments[0].decoded.length.should == 1026
+ mail.attachments[0].decoded.length.should eq 1026
end
it "should find an attachment that has an encoded name value" do
mail = Mail.read(fixture(File.join('emails', 'attachment_emails', 'attachment_with_encoded_name.eml')))
- mail.attachments.length.should == 1
+ mail.attachments.length.should eq 1
result = mail.attachments[0].filename
if RUBY_VERSION >= '1.9'
expected = "01 Quien Te Dij\212at. Pitbull.mp3".force_encoding(result.encoding)
else
expected = "01 Quien Te Dij\212at. Pitbull.mp3"
end
- result.should == expected
+ result.should eq expected
end
it "should find attachments inside parts with content-type message/rfc822" do
mail = Mail.read(fixture(File.join("emails",
"attachment_emails",
"attachment_message_rfc822.eml")))
- mail.attachments.length.should == 1
- mail.attachments[0].decoded.length.should == 1026
+ mail.attachments.length.should eq 1
+ mail.attachments[0].decoded.length.should eq 1026
end
it "attach filename decoding (issue 83)" do
@@ -284,7 +284,7 @@ def check_decoded(actual, expected)
limitMAIL
mail = Mail.new(data)
#~ puts Mail::Encodings.decode_encode(mail.attachments[0].filename, :decode)
- mail.attachments[0].filename.should == "Foto0009.jpg"
+ mail.attachments[0].filename.should eq "Foto0009.jpg"
end
end
@@ -307,16 +307,16 @@ def check_decoded(actual, expected)
mail.attachments['test.pdf'] = File.read(fixture('attachments', 'test.pdf'))
mail.attachments['test.gif'] = File.read(fixture('attachments', 'test.gif'))
mail.attachments['test.jpg'] = File.read(fixture('attachments', 'test.jpg'))
- mail.attachments[0].filename.should == 'test.zip'
- mail.attachments[1].filename.should == 'test.pdf'
- mail.attachments[2].filename.should == 'test.gif'
- mail.attachments[3].filename.should == 'test.jpg'
+ mail.attachments[0].filename.should eq 'test.zip'
+ mail.attachments[1].filename.should eq 'test.pdf'
+ mail.attachments[2].filename.should eq 'test.gif'
+ mail.attachments[3].filename.should eq 'test.jpg'
mail2 = Mail.new(mail.encoded)
- mail2.attachments[0].filename.should == 'test.zip'
- mail2.attachments[1].filename.should == 'test.pdf'
- mail2.attachments[2].filename.should == 'test.gif'
- mail2.attachments[3].filename.should == 'test.jpg'
+ mail2.attachments[0].filename.should eq 'test.zip'
+ mail2.attachments[1].filename.should eq 'test.pdf'
+ mail2.attachments[2].filename.should eq 'test.gif'
+ mail2.attachments[3].filename.should eq 'test.jpg'
end
end
Oops, something went wrong.

0 comments on commit 650596f

Please sign in to comment.