mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@7de852d
This commit is contained in:
parent
994833085a
commit
79671ec57e
135 changed files with 4415 additions and 4885 deletions
|
@ -33,25 +33,12 @@ describe "Process.euid=" do
|
|||
|
||||
as_superuser do
|
||||
describe "if run by a superuser" do
|
||||
with_feature :fork do
|
||||
it "sets the effective user id for the current process if run by a superuser" do
|
||||
read, write = IO.pipe
|
||||
pid = Process.fork do
|
||||
begin
|
||||
read.close
|
||||
Process.euid = 1
|
||||
write << Process.euid
|
||||
write.close
|
||||
rescue Exception => e
|
||||
write << e << e.backtrace
|
||||
end
|
||||
Process.exit!
|
||||
end
|
||||
write.close
|
||||
euid = read.gets
|
||||
euid.should == "1"
|
||||
Process.wait pid
|
||||
end
|
||||
it "sets the effective user id for the current process if run by a superuser" do
|
||||
code = <<-RUBY
|
||||
Process.euid = 1
|
||||
puts Process.euid
|
||||
RUBY
|
||||
ruby_exe(code).should == "1\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue