aboutsummaryrefslogtreecommitdiffstats
path: root/test/fileutils
Commit message (Collapse)AuthorAgeFilesLines
* Try to test with rake-13.0.2 again.Hiroshi SHIBATA2020-12-191-5/+5
| | | | | | [ruby/fileutils] Make verbose output go to stdout instead of stderr This reverts commit 510df47f5f7f83918d3aa00316c8a5b959d80d7c.
* Make the test suite pass on real Android/Termux environmentYusuke Endoh2020-10-121-2/+7
| | | | Attempting to create a hard link raises EACCES
* Fix Encoding::CompatibilityError in `FileUtils::Entry_#join`Kazuhiro NISHIYAMA2020-06-221-3/+0
|
* Fix typosKazuhiro NISHIYAMA2020-06-221-2/+2
|
* Revert d231b8f95b35d8a344cec4f62d7bbdf360a70e1c and add debug printKazuhiro NISHIYAMA2020-06-221-1/+4
|
* Fix remove_entry error when path encoding is not compatible UTF-8Kazuhiro NISHIYAMA2020-06-221-0/+17
|
* Check symlink in tmpdir and do not use empty pathKazuhiro NISHIYAMA2020-06-221-1/+5
|
* Revert "[ruby/fileutils] Make verbose output go to stdout instead of stderr"Nobuyoshi Nakada2020-06-121-5/+5
| | | | | | This reverts commit 7cddb844e6d51f954c6669341b9cc656bd7d3492, because the test of rake 13.0.1 is depending on the previous behavior.
* [ruby/fileutils] Fix #install with "X" mode optionNobuyoshi Nakada2020-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FileUtils#install` methed raises an unexpected `TypeError`, when called with `mode:` option which has `"X"`. ``` $ ruby -rfileutils -e 'FileUtils.install("tmp/a", "tmp/b", mode: "o+X")' /opt/local/lib/ruby/2.7.0/fileutils.rb:942:in `directory?': no implicit conversion of File::Stat into String (TypeError) from /opt/local/lib/ruby/2.7.0/fileutils.rb:942:in `block (3 levels) in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `each_char' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `inject' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `block (2 levels) in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `each_slice' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `block in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `inject' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:973:in `fu_mode' from /opt/local/lib/ruby/2.7.0/fileutils.rb:883:in `block in install' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1588:in `block in fu_each_src_dest' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1604:in `fu_each_src_dest0' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1586:in `fu_each_src_dest' from /opt/local/lib/ruby/2.7.0/fileutils.rb:877:in `install' from -e:1:in `<main>' ``` In spite of that `symbolic_modes_to_i` considers the `File::Stat` `path` case at the beginning, in `"X"` case, `path` is passed to `FileTest.directory?` method which requires a `String`. In such case, the mode in `path` should be examined instead. https://github.com/ruby/fileutils/commit/af675af6b2
* [ruby/fileutils] Make verbose output go to stdout instead of stderrJeremy Evans2020-06-121-5/+5
| | | | | | | | | Verbose output is not error output, and should be sent to stdout and not stderr. Fixes Ruby bug 4436 https://github.com/ruby/fileutils/commit/563a383025
* Fix error in `remove_entry`Kazuhiro NISHIYAMA2020-06-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | When `LANG=C`, dir is `UTF-8` and `base` is 'ASCII-8BIT` in `FileUtils::Entry_#join`. So `Encoding::CompatibilityError` occurred and files are not removed. https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20200611T060002Z.fail.html.gz ``` 1) Error: WEBrick::TestFileHandler#test_cjk_in_path: Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/tmp/???20200611-1887828-3nn72a /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1460:in `rmdir' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1460:in `block in remove_dir1' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1471:in `platform_support' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1459:in `remove_dir1' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1452:in `remove' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:780:in `block in remove_entry' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1509:in `ensure in postorder_traverse' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1509:in `postorder_traverse' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:778:in `remove_entry' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/tmpdir.rb:97:in `mktmpdir' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/test/webrick/test_filehandler.rb:292:in `test_cjk_in_path' ```
* Revert "[ruby/fileutils] Fix #install with "X" mode option"Hiroshi SHIBATA2019-11-301-2/+0
| | | | | | This reverts commit eab88d20eaa925d5e61a2a65820a099b46ccf3f8. The some CI was broken with this.
* [ruby/fileutils] Fix #install with "X" mode optionNobuyoshi Nakada2019-11-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FileUtils#install` methed raises an unexpected `TypeError`, when called with `mode:` option which has `"X"`. ``` $ ruby -rfileutils -e 'FileUtils.install("tmp/a", "tmp/b", mode: "o+X")' /opt/local/lib/ruby/2.7.0/fileutils.rb:942:in `directory?': no implicit conversion of File::Stat into String (TypeError) from /opt/local/lib/ruby/2.7.0/fileutils.rb:942:in `block (3 levels) in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `each_char' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `inject' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `block (2 levels) in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `each_slice' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `block in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `inject' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:973:in `fu_mode' from /opt/local/lib/ruby/2.7.0/fileutils.rb:883:in `block in install' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1588:in `block in fu_each_src_dest' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1604:in `fu_each_src_dest0' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1586:in `fu_each_src_dest' from /opt/local/lib/ruby/2.7.0/fileutils.rb:877:in `install' from -e:1:in `<main>' ``` In spite of that `symbolic_modes_to_i` considers the `File::Stat` `path` case at the beginning, in `"X"` case, `path` is passed to `FileTest.directory?` method which requires a `String`. In such case, the mode in `path` should be examined instead. https://github.com/ruby/fileutils/commit/2ea54ade2f
* [ruby/fileutils] Added `test_install_mode_option`Nobuyoshi Nakada2019-11-301-0/+24
| | | | https://github.com/ruby/fileutils/commit/bb10efe104
* [ruby/fileutils] Use pend instead of skipHiroshi SHIBATA2019-10-031-2/+2
| | | | https://github.com/ruby/fileutils/commit/ba2c24e2d7
* [ruby/fileutils] Fix test_cp_r_dev on Windows or other systems without ↵Jeremy Evans2019-09-271-4/+4
| | | | | | | | | | | | | character/block device in /dev Previously this would give an error such as: TestFileUtils#test_cp_r_dev [c:/fileutils/test/fileutils/test_fileutils.rb:455]: [RuntimeError] exception expected, not. Class: <TypeError> Message: <"no implicit conversion of nil into String"> https://github.com/ruby/fileutils/commit/0ce0fefbeb
* [ruby/fileutils] Do not break in verbose mode if using FileUtils with a ↵Jeremy Evans2019-09-271-0/+24
| | | | | | | | | | | | | frozen object If FileUtils is included into another object, and verbose mode is used, a FrozenError is currently raised unless the object has the @fileutils_output and @fileutils_label instance variables. This fixes things so that it does not attempt to set the instance variables, but it still uses them if they are present. https://github.com/ruby/fileutils/commit/689cb9c56a
* [ruby/fileutils] Skip test_cp_r_socket on JRubyJeremy Evans2019-09-271-0/+1
| | | | https://github.com/ruby/fileutils/commit/20bb9ec789
* [ruby/fileutils] Make copy methods handle FIFOs and UNIX socketsJeremy Evans2019-09-271-0/+28
| | | | | | | | | | | | | | | | | | Previously, this was broken. Trying to copy a FIFO would raise a NoMethodError if File.mkfifo was defined. Trying to copy a UNIX socket would raise a RuntimeError as File.mknod is not something Ruby defines. Handle the FIFO issue using File.mkfifo instead of mkfifo. Handle the UNIX Socket issue by creating a unix socket. Continue to not support character or block devices, raising a RuntimeError for both. Add tests for FIFO, UNIX Socket, and character/block devices. https://github.com/ruby/fileutils/commit/123903532d
* Improve same directory detection in FileUtilsJustin Collins2019-08-061-0/+10
| | | | Closes: https://github.com/ruby/ruby/pull/1425
* Guard out the test when it is run under root permissionmame2019-03-141-6/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Run r66972 assertion only when a sticky-bit makes sensenobu2019-02-011-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix exception namespacenobu2019-01-311-0/+8
| | | | | | | | | * lib/fileutils.rb (remove_entry_secure): EISDIR is under the Errno namespace. [ruby-core:91362] [Bug #15577] From: Tietew (Toru Iwase) <tietew@tietew.net> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Retry to merge fileutils-1.1.0.hsbt2018-05-151-8/+14
| | | | | | | | | * Revert "Revert "Merge fileutils-1.1.0."" This reverts commit 84bb8e81c25d4d7d6020c3acfbbc36e9064200fa. * Added workaround for make mjit-headers git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Merge fileutils-1.1.0."mame2018-05-151-14/+8
| | | | | | | | | | | | | This reverts commit 99da3d2570e110d3024039102205f6d64174bf5e. The change caused the following build failure: ``` .../ruby/lib/fileutils.rb:88:in `require': cannot load such file -- rbconfig (LoadError) uncommon.mk:987: recipe for target 'encdb.h' failed make: *** [encdb.h] Error 1 ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge fileutils-1.1.0.hsbt2018-05-151-8/+14
| | | | | | | This version was migrated JRuby paches. https://github.com/ruby/fileutils/pull/18 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add FileUtils#cp_lrmame2018-03-131-0/+39
| | | | | | | | | * lib/fileutils.rb: Add FileUtils#cp_lr. This method creates hard links of each file from directory to another directory recursively. This patch is based on Thomas Sawyers and Zachary Scott. [Feature #4189] [ruby-core:33820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rename test classes to allow stable test count when running test-all -jnobu2018-03-134-5/+5
| | | | | | | | [Fix GH-1763] From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix test-all tests to avoid creating report_on_exception warningseregon2017-12-121-0/+1
| | | | | | | | | * The warnings are shown by Thread.report_on_exception defaulting to true. [Feature #14143] [ruby-core:83979] * Improves tests by narrowing down the scope where an exception is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix r60281ko12017-10-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_cp_preserve_permissions should care about umaskkosaki2017-10-211-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* File.symlink is not potableusa2017-10-211-2/+2
| | | | | | | | * test/fileutils/test_fileutils.rb: skip tests using File.symlink if it's not available. this problem is reported by ko1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Overwrite destination symlink file if `remove_destination` is set.hsbt2017-10-201-2/+19
| | | | | | | [Bug #13914][ruby-core:82846] Patch by @mzp https://github.com/ruby/fileutils/pull/9 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_fileutils.rb: rmdir should fail on nonexistent directorynobu2017-09-161-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: error at rmdirnobu2017-09-161-0/+9
| | | | | | | * lib/fileutils.rb (rmdir): should not ignore errors first, except for parent directories. [ruby-dev:50236] [Bug #13889] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Should call `ln_s` only when symlink is availableusa2017-05-151-5/+7
| | | | | | | | | | | * test/fileutils/test_fileutils.rb (test_ln_s): skip if symlink is not available. * test/fileutils/test_fileutils.rb (test_ln_s): remove created symlink certainly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_fileutils.rb: no broken symlinks on Cygwinnobu2017-02-171-4/+36
| | | | | | | | * test/fileutils/test_fileutils.rb (no_broken_symlink): exclude test using broken symlinks on Cygwin, which are not allowed because of the directory flag of Windows native symlink. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_fileutils.rb: fix relative symlink pathnobu2017-02-171-1/+3
| | | | | | | | * test/fileutils/test_fileutils.rb (test_rm_symlink): fix relative symlink path, the target should be relative to the directory in which the symlink gets created. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_fileutils.rb: workaround for Cygwinnobu2017-02-171-0/+4
| | | | | | | * test/fileutils/test_fileutils.rb (root_in_posix): seems Cygwin has some different conditions for privilege. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_fileutils.rb: cache distinct UIDsnobu2017-02-171-34/+21
| | | | | | | | * test/fileutils/test_fileutils.rb: cache distinct UIDs as constants at initialization. assume no UIDs will be added/removed during tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: do not make rootnobu2017-02-161-0/+18
| | | | | | | | | * lib/fileutils.rb (FileUtils#mkdir_p): no need to make root directory which should be exist and cannot be made with mkdir recent Cygwin can make a directory contains a colon. [Bug #13214] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/fileutils.rb: Specify frozen_string_literal: true.kazu2017-01-077-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_fileutils.rb: fix deadlocknobu2016-11-241-2/+15
| | | | | | | | | * test/fileutils/test_fileutils.rb (assert_output_lines): ensure that write pipe is closed, not the reader thread to deadlock when an exception raised in the given block. [ruby-core:78053] [Bug #12910] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_fileutils.rb: Use primary group toonobu2016-11-231-1/+1
| | | | | | | | | | | | * test/fileutils/test_fileutils.rb (TestFileUtils#setup): Use primary group as well as supplementary groups. based on the patch by Vít Ondruch at [ruby-core:78053]. [Bug #12910] It might happen in certain environments (systemd-nspawn) that process has no supplementary groups, but primary groups should be enough to pass most of the tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: fix error for non-existent entrynobu2016-11-041-0/+5
| | | | | | | | * lib/fileutils.rb (FileUtils::Entry_#copy): ensure that the source entry exists first, to fix error for non-existent entry. [ruby-core:77885] [Bug #12892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_fileutils.rb: use Dir.mktmpdirnobu2016-09-231-6/+3
| | | | | | | * test/fileutils/test_fileutils.rb: use Dir.mktmpdir instead of fixed name for temporary directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* FileUtils#install: owner/group optionsnobu2016-06-271-0/+16
| | | | | | | * lib/fileutils.rb (FileUtils#install): add owner and group options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-167-0/+7
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/fileutils/test_fileutils.rb: add debug output to investigate the ↵usa2015-12-061-1/+6
| | | | | | error that occur at random on Windows CI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* relax error message formatnobu2015-10-241-1/+1
| | | | | | | * test/fileutils/test_fileutils.rb (test_uptodate): relax error message format. [Feature #9025], [ruby-core:71178] [Bug #11617] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e