Before

1# frozen_string_literal: true
2require 'spec_helper'
3
4RSpec.describe Mail::ReturnPathField do
5 it "should allow you to specify a field" do
6 rp = Mail::ReturnPathField.new('mikel@test.lindsaar.net')
7 expect(rp.address).to eq 'mikel@test.lindsaar.net'
8 end
9
10 it "should encode the addr_spec in <>" do
11 rp = Mail::ReturnPathField.new('mikel@test.lindsaar.net')
12 expect(rp.encoded).to eq "Return-Path: <mikel@test.lindsaar.net>\r\n"
13 end
14
15 it "should accept <>" do
16 rp = Mail::ReturnPathField.new('<>')
17 expect(rp.encoded).to eq "Return-Path: <>\r\n"
18 end
19
20 it "should set the return path" do
21 mail = Mail.new do
22 to "to@someemail.com"
23 from "from@someemail.com"
24 subject "Can't set the return-path"
25 return_path "bounce@someemail.com"
26 message_id "<1234@someemail.com>"
27 body "body"
28 end
29 expect(mail.return_path).to eq "bounce@someemail.com"
30 end
31
32 it "should set the return path" do
33 mail = Mail.new do
34 to "to@someemail.com"
35 from "from@someemail.com"
36 subject "Can't set the return-path"
37 return_path "bounce@someemail.com"
38 message_id "<1234@someemail.com>"
39 body "body"
40 end
41 encoded_mail = Mail.new(mail.encoded)
42 expect(encoded_mail.return_path).to eq "bounce@someemail.com"
43 end
44
45 it "should wrap the return path addr_spec in <>" do
46 mail = Mail.new do
47 to "to@someemail.com"
48 from "from@someemail.com"
49 subject "Can't set the return-path"
50 return_path "bounce@someemail.com"
51 message_id "<1234@someemail.com>"
52 body "body"
53 end
54 expect(mail.encoded).to match(/<bounce@someemail\.com>/)
55 end
56
57
58end
59

After

1# frozen_string_literal: true
2require 'spec_helper'
3
4RSpec.describe Mail::ReturnPathField do
5 it "should allow you to specify a field" do
6 rp = Mail::ReturnPathField.new('mikel@test.lindsaar.net')
7 expect(rp.address).to eq 'mikel@test.lindsaar.net'
8 end
9
10 it "should encode the addr_spec in <>" do
11 rp = Mail::ReturnPathField.new('mikel@test.lindsaar.net')
12 expect(rp.encoded).to eq "Return-Path: <mikel@test.lindsaar.net>\r\n"
13 end
14
15 it "should accept <>" do
16 rp = Mail::ReturnPathField.new('<>')
17 expect(rp.encoded).to eq "Return-Path: <>\r\n"
18 end
19
20 it "should set the return path" do
21 mail = Mail.new do
22 to "to@someemail.com"
23 from "from@someemail.com"
24 subject "Can't set the return-path"
25 return_path "bounce@someemail.com"
26 message_id "<1234@someemail.com>"
27 body "body"
28 end
29 expect(mail.return_path).to eq "bounce@someemail.com"
30 end
31
32 it "should set the return path" do
33 mail = Mail.new do
34 to "to@someemail.com"
35 from "from@someemail.com"
36 subject "Can't set the return-path"
37 return_path "bounce@someemail.com"
38 message_id "<1234@someemail.com>"
39 body "body"
40 end
41 encoded_mail = Mail.new(mail.encoded)
42 expect(encoded_mail.return_path).to eq "bounce@someemail.com"
43 end
44
45 it "should wrap the return path addr_spec in <>" do
46 mail = Mail.new do
47 to "to@someemail.com"
48 from "from@someemail.com"
49 subject "Can't set the return-path"
50 return_path "bounce@someemail.com"
51 message_id "<1234@someemail.com>"
52 body "body"
53 end
54 expect(mail.encoded).to match(/<bounce@someemail\.com>/)
55 end
56
57
58end
59

Before

program
comment "# frozen_string_literal: true"
call
identifier "require"
argument_list
string
" "'"
string_content "spec_helper"
" "'"
call (+431 nodes collapsed)

After

program
comment "# frozen_string_literal: true"
call
identifier "require"
argument_list
string
" "'"
string_content "spec_helper"
" "'"
call (+431 nodes collapsed)