Skip to content

Commit

Permalink
Specs: fix expect-style that wasn't backported to old should-style
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed May 15, 2017
1 parent b5a2884 commit b9cee02
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions spec/mail/network/delivery_methods/smtp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ def redefine_verify_none(new_value)
to "to@somemail.com"
end

expect(mail.smtp_envelope_from).to eq addr
mail.smtp_envelope_from.should eq addr

expect do
doing {
mail.deliver
end.to raise_error(ArgumentError, "SMTP From address may not contain CR or LF line breaks: #{addr.inspect}")
}.should raise_error(ArgumentError, "SMTP From address may not contain CR or LF line breaks: #{addr.inspect}")
end

it "should raise on SMTP injection via RCPT TO newlines" do
Expand All @@ -212,11 +212,11 @@ def redefine_verify_none(new_value)
to addr
end

expect(mail.smtp_envelope_to).to eq [addr]
mail.smtp_envelope_to.should eq [addr]

expect do
doing {
mail.deliver
end.to raise_error(ArgumentError, "SMTP To address may not contain CR or LF line breaks: #{addr.inspect}")
}.should raise_error(ArgumentError, "SMTP To address may not contain CR or LF line breaks: #{addr.inspect}")
end

it "should raise on SMTP injection via MAIL FROM overflow" do
Expand All @@ -227,11 +227,11 @@ def redefine_verify_none(new_value)
to "to@somemail.com"
end

expect(mail.smtp_envelope_from).to eq addr
mail.smtp_envelope_from.should eq addr

expect do
doing {
mail.deliver
end.to raise_error(ArgumentError, "SMTP From address may not exceed 2kB: #{addr.inspect}")
}.should raise_error(ArgumentError, "SMTP From address may not exceed 2kB: #{addr.inspect}")
end

it "should raise on SMTP injection via RCPT TO overflow" do
Expand All @@ -242,11 +242,11 @@ def redefine_verify_none(new_value)
to addr
end

expect(mail.smtp_envelope_to).to eq [addr]
mail.smtp_envelope_to.should eq [addr]

expect do
doing {
mail.deliver
end.to raise_error(ArgumentError, "SMTP To address may not exceed 2kB: #{addr.inspect}")
}.should raise_error(ArgumentError, "SMTP To address may not exceed 2kB: #{addr.inspect}")
end
end
end

0 comments on commit b9cee02

Please sign in to comment.