* lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
should properly ignore MiniTest::Skip * lib/minitest/unit.rb (MiniTest::Assertions::assert_raises): ditto. * test/net/imap/test_imap.rb: Properly skip SSL tests when localhost is not 127.0.0.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
64beb15dbc
commit
6bab4ea991
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
Wed Sep 15 14:59:49 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
|
||||||
|
should properly ignore MiniTest::Skip
|
||||||
|
|
||||||
|
* lib/minitest/unit.rb (MiniTest::Assertions::assert_raises):
|
||||||
|
ditto.
|
||||||
|
|
||||||
|
* test/net/imap/test_imap.rb: Properly skip SSL tests when
|
||||||
|
localhost is not 127.0.0.1.
|
||||||
|
|
||||||
Wed Sep 15 13:37:00 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
|
Wed Sep 15 13:37:00 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
|
||||||
|
|
||||||
* test/net/imap/test_imap.rb: "localhost" not guaranteed to
|
* test/net/imap/test_imap.rb: "localhost" not guaranteed to
|
||||||
|
@ -222,6 +222,8 @@ module MiniTest
|
|||||||
begin
|
begin
|
||||||
yield
|
yield
|
||||||
should_raise = true
|
should_raise = true
|
||||||
|
rescue MiniTest::Skip
|
||||||
|
raise
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
details = "#{msg}#{mu_pp(exp)} exception expected, not"
|
details = "#{msg}#{mu_pp(exp)} exception expected, not"
|
||||||
assert(exp.any? { |ex|
|
assert(exp.any? { |ex|
|
||||||
|
@ -32,6 +32,8 @@ module Test
|
|||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
line = __LINE__; yield
|
line = __LINE__; yield
|
||||||
|
rescue MiniTest::Skip
|
||||||
|
raise
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
bt = e.backtrace
|
bt = e.backtrace
|
||||||
as = e.instance_of?(MiniTest::Assertion)
|
as = e.instance_of?(MiniTest::Assertion)
|
||||||
|
@ -49,9 +49,13 @@ class IMAPTest < Test::Unit::TestCase
|
|||||||
if defined?(OpenSSL)
|
if defined?(OpenSSL)
|
||||||
assert_raise(OpenSSL::SSL::SSLError) do
|
assert_raise(OpenSSL::SSL::SSLError) do
|
||||||
imaps_test do |port|
|
imaps_test do |port|
|
||||||
Net::IMAP.new("localhost",
|
begin
|
||||||
:port => port,
|
Net::IMAP.new("localhost",
|
||||||
:ssl => true)
|
:port => port,
|
||||||
|
:ssl => true)
|
||||||
|
rescue SystemCallError
|
||||||
|
skip $!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -61,9 +65,13 @@ class IMAPTest < Test::Unit::TestCase
|
|||||||
if defined?(OpenSSL)
|
if defined?(OpenSSL)
|
||||||
assert_nothing_raised do
|
assert_nothing_raised do
|
||||||
imaps_test do |port|
|
imaps_test do |port|
|
||||||
Net::IMAP.new("localhost",
|
begin
|
||||||
:port => port,
|
Net::IMAP.new("localhost",
|
||||||
:ssl => { :ca_file => CA_FILE })
|
:port => port,
|
||||||
|
:ssl => { :ca_file => CA_FILE })
|
||||||
|
rescue SystemCallError
|
||||||
|
skip $!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -104,6 +112,8 @@ class IMAPTest < Test::Unit::TestCase
|
|||||||
imap
|
imap
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue SystemCallError
|
||||||
|
skip $!
|
||||||
ensure
|
ensure
|
||||||
if imap && !imap.disconnected?
|
if imap && !imap.disconnected?
|
||||||
imap.disconnect
|
imap.disconnect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user