File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 - name : Install dependencies
2727 run : bundle install
2828 - name : Run test
29- run : rake test
29+ run : bundle exec rake test
Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ group :development do
66 gem "bundler"
77 gem "rake"
88 gem "test-unit"
9+ gem "test-unit-ruby-core" , git : "https://github.com/ruby/test-unit-ruby-core"
910end
Original file line number Diff line number Diff line change 22
33require 'net/smtp'
44require 'test/unit'
5+ require "core_assertions"
6+
7+ Test ::Unit ::TestCase . include Test ::Unit ::CoreAssertions
58
69module Net
710 class TestSMTP < Test ::Unit ::TestCase
@@ -628,6 +631,19 @@ def test_quit!
628631 smtp . quit!
629632 end
630633
634+ def test_quit_and_warn
635+ server = FakeServer . start
636+ def server . quit
637+ @sock . puts "400 BUSY\r \n "
638+ end
639+ smtp = Net ::SMTP . start 'localhost' , server . port
640+ assert_warn ( /SMTPServerBusy during .*#quit!/i ) do
641+ smtp . quit! ( exception : :warn )
642+ end
643+ assert_equal "QUIT\r \n " , server . commands . last
644+ refute smtp . started?
645+ end
646+
631647 def test_quit_and_reraise
632648 server = FakeServer . start
633649 def server . quit
You can’t perform that action at this time.
0 commit comments