ruby-changes:54357
From: mame <ko1@a...>
Date: Wed, 26 Dec 2018 16:04:34 +0900 (JST)
Subject: [ruby-changes:54357] mame:r66571 (trunk): spec/ruby/library/socket/socket/bind_spec.rb: allow to run under docker
mame 2018-12-26 16:04:31 +0900 (Wed, 26 Dec 2018) New Revision: 66571 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66571 Log: spec/ruby/library/socket/socket/bind_spec.rb: allow to run under docker A root user runs the spec without Errno::EACCES Modified files: trunk/spec/ruby/library/socket/socket/bind_spec.rb Index: spec/ruby/library/socket/socket/bind_spec.rb =================================================================== --- spec/ruby/library/socket/socket/bind_spec.rb (revision 66570) +++ spec/ruby/library/socket/socket/bind_spec.rb (revision 66571) @@ -112,11 +112,13 @@ describe 'Socket#bind' do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/socket/socket/bind_spec.rb#L112 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/