diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-26 07:04:31 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-26 07:04:31 +0000 |
commit | 2914522ffc39c22dfdccf5ad68162232c5cd0d35 (patch) | |
tree | 6b7f0aa000523089fa9c5e9d2023273be11abf21 /spec/ruby/library | |
parent | 7453cdba1b62d6f6533f8c7bfdf6011524e11853 (diff) | |
download | ruby-2914522ffc39c22dfdccf5ad68162232c5cd0d35.tar.gz |
spec/ruby/library/socket/socket/bind_spec.rb: allow to run under docker
A root user runs the spec without Errno::EACCES
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library')
-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 |