test_nonblock.rb: use assert_predicate
* test/socket/test_nonblock.rb (test_recv_nonblock_no_exception), (test_recvfrom_nonblock_no_exception): use assert_predicate for failure messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
85d5df5528
commit
c2c81723a4
@ -290,7 +290,7 @@ class TestSocketNonblock < Test::Unit::TestCase
|
|||||||
udp_pair do |s1, s2|
|
udp_pair do |s1, s2|
|
||||||
assert_equal :wait_readable, s1.recvfrom_nonblock(100, exception: false)
|
assert_equal :wait_readable, s1.recvfrom_nonblock(100, exception: false)
|
||||||
s2.send("aaa", 0)
|
s2.send("aaa", 0)
|
||||||
assert s1.wait_readable
|
assert_predicate s1, :wait_readable
|
||||||
mesg, inet_addr = s1.recvfrom_nonblock(100, exception: false)
|
mesg, inet_addr = s1.recvfrom_nonblock(100, exception: false)
|
||||||
assert_equal(4, inet_addr.length)
|
assert_equal(4, inet_addr.length)
|
||||||
assert_equal("aaa", mesg)
|
assert_equal("aaa", mesg)
|
||||||
@ -358,7 +358,7 @@ class TestSocketNonblock < Test::Unit::TestCase
|
|||||||
tcp_pair {|c, s|
|
tcp_pair {|c, s|
|
||||||
assert_equal :wait_readable, c.recv_nonblock(11, exception: false)
|
assert_equal :wait_readable, c.recv_nonblock(11, exception: false)
|
||||||
s.write('HI')
|
s.write('HI')
|
||||||
assert c.wait_readable
|
assert_predicate c, :wait_readable
|
||||||
assert_equal 'HI', c.recv_nonblock(11, exception: false)
|
assert_equal 'HI', c.recv_nonblock(11, exception: false)
|
||||||
assert_equal :wait_readable, c.recv_nonblock(11, exception: false)
|
assert_equal :wait_readable, c.recv_nonblock(11, exception: false)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user