diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-25 09:50:29 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-25 09:50:29 +0000 |
commit | 7dc0bdb6e58d4bffd3f44e56fe63ca9f79adb3f8 (patch) | |
tree | 5f9c32394f839407a98a40fc4d06edf9c50e2af9 /spec/ruby/core/file/umask_spec.rb | |
parent | 429e2abfad7770c90b9f1bed70e5e49c19e37a60 (diff) |
Remove specs trying arbitrary values for chmod and umask
* Instead assert that too large values raise RangeError.
* [Bug #14375] [ruby-core:84933]
* See https://github.com/ruby/ruby/pull/1797
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/file/umask_spec.rb')
-rw-r--r-- | spec/ruby/core/file/umask_spec.rb | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/spec/ruby/core/file/umask_spec.rb b/spec/ruby/core/file/umask_spec.rb index 53a07b6a54..4008cad449 100644 --- a/spec/ruby/core/file/umask_spec.rb +++ b/spec/ruby/core/file/umask_spec.rb @@ -30,31 +30,9 @@ describe "File.umask" do end end - 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 + it "raises RangeError with too large values" do + -> { File.umask(2**64) }.should raise_error(RangeError) + -> { File.umask(-2**63 - 1) }.should raise_error(RangeError) end it "raises ArgumentError when more than one argument is provided" do |