Permalink
Browse files

Fix spec to support 1.8.7 as well

  • Loading branch information...
1 parent 718a9d1 commit 38086a3997176bbb394e16d133eedad452396134 @mikel committed Nov 16, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 spec/mail/message_spec.rb
View
8 spec/mail/message_spec.rb
@@ -295,8 +295,12 @@ def basic_email
it "should parse non-UTF8 sources" do
mail = Mail::Message.new(File.read(fixture('emails', 'multi_charset', 'japanese_shiftjis.eml')))
mail.to.should eq ["raasdnil@gmail.com"]
- body_text = mail.body.decoded.force_encoding("iso-2022-jp").encode("UTF-8")
- body_text.should eq "すみません。"
+ if RUBY_VERSION >= '1.9'
+ expected = mail.body.decoded.force_encoding("iso-2022-jp").encode("UTF-8")
+ else
+ expected = "すみません。"
+ end
+ expected.should eq "すみません。"
end
end

0 comments on commit 38086a3

Please sign in to comment.