1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

r61950 changes mode_t to ushort on FreeBSD and Darwin

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2018-01-19 18:55:32 +00:00
parent c4380069b7
commit c151679cc3
2 changed files with 64 additions and 14 deletions

View file

@ -30,12 +30,31 @@ describe "File.umask" do
end
end
it "always succeeds with any integer values" do
vals = [-2**30, -2**16, -2**8, -2,
-1.5, -1, 0.5, 0, 1, 2, 7.77777, 16, 32, 64, 2**8, 2**16, 2**30]
vals.each { |v|
lambda { File.umask(v) }.should_not raise_error
}
platform_is_not :freebsd, :darwin do
it "always succeeds with any integer values" do
vals = [-2**30, -2**16, -2**8, -2,
-1.5, -1, 0.5, 0, 1, 2, 7.77777, 16, 32, 64, 2**8, 2**16, 2**30]
vals.each { |v|
lambda { File.umask(v) }.should_not raise_error
}
end
end
platform_is :freebsd, :darwin do
it "always succeeds with any integer values" do
vals = [-2**8, -2,
-1.5, -1, 0.5, 0, 1, 2, 7.77777, 16, 32, 64, 2**8]
vals.each { |v|
lambda { File.umask(v) }.should_not raise_error
}
end
it "fails with invalid values" do
vals = [-2**30, -2**16, 2**16, 2**30]
vals.each { |v|
lambda { File.chmod(v, @file) }.should raise_error(RangeError)
}
end
end
it "raises ArgumentError when more than one argument is provided" do