diff options
-rw-r--r-- | spec/ruby/library/socket/socket/bind_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/ruby/library/socket/socket/bind_spec.rb b/spec/ruby/library/socket/socket/bind_spec.rb index 338b19bbfc..3a7df6ed71 100644 --- a/spec/ruby/library/socket/socket/bind_spec.rb +++ b/spec/ruby/library/socket/socket/bind_spec.rb @@ -112,11 +112,13 @@ describe 'Socket#bind' do end platform_is_not :windows do - it 'raises Errno::EACCES when the user is not allowed to bind to the port' do - sockaddr1 = Socket.pack_sockaddr_in(1, ip_address) + as_user do + it 'raises Errno::EACCES when the user is not allowed to bind to the port' do + sockaddr1 = Socket.pack_sockaddr_in(1, ip_address) - lambda { @socket.bind(sockaddr1); }.should raise_error(Errno::EACCES) - end + lambda { @socket.bind(sockaddr1) }.should raise_error(Errno::EACCES) + end + end end end |