summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_build_command.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-04-22 14:37:42 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-04-28 10:57:21 +0900
commit2c2b0d4ec1bc3ede33b056e24dea011edc69bd5f (patch)
tree5c1c593ac2551ba4ce866ba9bf3438168dc478a1 /test/rubygems/test_gem_commands_build_command.rb
parentde58dfc911738b2cbb2b848fa2e2cc93616a0ec5 (diff)
[rubygems/rubygems] Make the test suite pass under `umask 077`
Some tests had failed under `umask 077` mode. As far as I investigated, there is no actual bug. All failures were caused by tests that create a wrong-permission file or expect wrong permission. This changeset fixes the tests. https://github.com/rubygems/rubygems/commit/078213e527
Diffstat (limited to 'test/rubygems/test_gem_commands_build_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb
index ca9f8b66c9..9dfba75cf5 100644
--- a/test/rubygems/test_gem_commands_build_command.rb
+++ b/test/rubygems/test_gem_commands_build_command.rb
@@ -17,8 +17,13 @@ class TestGemCommandsBuildCommand < Gem::TestCase
readme_file = File.join(@tempdir, 'README.md')
- File.open readme_file, 'w' do |f|
- f.write 'My awesome gem'
+ begin
+ umask_orig = File.umask(2)
+ File.open readme_file, 'w' do |f|
+ f.write 'My awesome gem'
+ end
+ ensure
+ File.umask(umask_orig)
end
@gem = util_spec 'some_gem' do |s|