Skip to content

Commit

Permalink
Merge pull request #1568 from mikel/issue1567
Browse files Browse the repository at this point in the history
Test string is 1 char short of 78
  • Loading branch information
eval authored Jan 3, 2024
2 parents 15cd261 + 943ff4b commit 3dd53e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions spec/mail/fields/unstructured_field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,14 @@

describe "folding" do

it "should not fold itself if it is 78 chracters long" do
@field = Mail::UnstructuredField.new("Subject", "This is a subject header message that is _exactly_ 78 characters....")
expect(@field.encoded).to eq "Subject: This is a subject header message that is _exactly_ 78 characters....\r\n"
it "should not fold itself if it is 78 characters long" do
subject = "This is a subject header message that is _exactly_ 78 characters....."
expected = "Subject: #{subject}\r\n"
expect(expected.length).to eq 80 # including CRLF
@field = Mail::UnstructuredField.new("Subject", subject)
encoded = @field.encoded
expect(encoded).to eq expected
expect(encoded.length).to eq 80 # including CRLF
end

it "should fold itself if it is 79 chracters long" do
Expand Down

0 comments on commit 3dd53e0

Please sign in to comment.