diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-16 13:57:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-16 13:57:18 +0000 |
commit | ff88c2a9d38215dcade39f423bb6b49928b4fb70 (patch) | |
tree | d9b1c014b13c7c34c852b7ee4f5bd9c65bff4358 /spec/rubyspec/library | |
parent | 9bb63a50f5472621869ed39b18dae3588cb27efb (diff) | |
download | ruby-ff88c2a9d38215dcade39f423bb6b49928b4fb70.tar.gz |
Use raise_error block
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/rubyspec/library')
-rw-r--r-- | spec/rubyspec/library/socket/tcpsocket/shared/new.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/rubyspec/library/socket/tcpsocket/shared/new.rb b/spec/rubyspec/library/socket/tcpsocket/shared/new.rb index f745a69f67..d172456923 100644 --- a/spec/rubyspec/library/socket/tcpsocket/shared/new.rb +++ b/spec/rubyspec/library/socket/tcpsocket/shared/new.rb @@ -9,7 +9,9 @@ describe :tcpsocket_new, shared: true do it "refuses the connection when there is no server to connect to" do lambda do TCPSocket.send(@method, SocketSpecs.hostname, SocketSpecs.reserved_unused_port) - end.should raise_error([Errno::ECONNREFUSED, Errno::EADDRNOTAVAIL]) + end.should raise_error(SystemCallError) {|e| + [Errno::ECONNREFUSED, Errno::EADDRNOTAVAIL].should include(e.class) + } end describe "with a running server" do |