* lib/net/smtp.rb: refactoring Net::SMTP#esmtp= to use an
attr_accessor git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
df8e7db7c5
commit
0a2392a50a
@ -1,3 +1,8 @@
|
|||||||
|
Thu Dec 23 08:12:59 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
|
* lib/net/smtp.rb: refactoring Net::SMTP#esmtp= to use an
|
||||||
|
attr_accessor
|
||||||
|
|
||||||
Thu Dec 23 06:35:41 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
Thu Dec 23 06:35:41 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* lib/net/smtp.rb: Net::SMTP should close the SSL connection if the
|
* lib/net/smtp.rb: Net::SMTP should close the SSL connection if the
|
||||||
|
@ -229,11 +229,6 @@ module Net
|
|||||||
"#<#{self.class} #{@address}:#{@port} started=#{@started}>"
|
"#<#{self.class} #{@address}:#{@port} started=#{@started}>"
|
||||||
end
|
end
|
||||||
|
|
||||||
# +true+ if the SMTP object uses ESMTP (which it does by default).
|
|
||||||
def esmtp?
|
|
||||||
@esmtp
|
|
||||||
end
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set whether to use ESMTP or not. This should be done before
|
# Set whether to use ESMTP or not. This should be done before
|
||||||
# calling #start. Note that if #start is called in ESMTP mode,
|
# calling #start. Note that if #start is called in ESMTP mode,
|
||||||
@ -241,11 +236,10 @@ module Net
|
|||||||
# object will automatically switch to plain SMTP mode and
|
# object will automatically switch to plain SMTP mode and
|
||||||
# retry (but not vice versa).
|
# retry (but not vice versa).
|
||||||
#
|
#
|
||||||
def esmtp=(bool)
|
attr_accessor :esmtp
|
||||||
@esmtp = bool
|
|
||||||
end
|
|
||||||
|
|
||||||
alias esmtp esmtp?
|
# +true+ if the SMTP object uses ESMTP (which it does by default).
|
||||||
|
alias :esmtp? :esmtp
|
||||||
|
|
||||||
# true if server advertises STARTTLS.
|
# true if server advertises STARTTLS.
|
||||||
# You cannot get valid value before opening SMTP session.
|
# You cannot get valid value before opening SMTP session.
|
||||||
|
16
test/net/smtp/test_smtp.rb
Normal file
16
test/net/smtp/test_smtp.rb
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
require 'net/smtp'
|
||||||
|
require 'minitest/autorun'
|
||||||
|
|
||||||
|
module Net
|
||||||
|
class TestSMTP < MiniTest::Unit::TestCase
|
||||||
|
def test_esmtp
|
||||||
|
smtp = Net::SMTP.new 'localhost', 25
|
||||||
|
assert smtp.esmtp
|
||||||
|
assert smtp.esmtp?
|
||||||
|
|
||||||
|
smtp.esmtp = 'omg'
|
||||||
|
assert_equal 'omg', smtp.esmtp
|
||||||
|
assert_equal 'omg', smtp.esmtp?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user