Граф коммитов

130 Коммитов

Автор SHA1 Сообщение Дата
usa a852853f44 Should call `ln_s` only when symlink is available
* 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
2017-05-15 07:35:26 +00:00
nobu 3d031cea42 test_fileutils.rb: no broken symlinks on Cygwin
* 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
2017-02-17 13:31:43 +00:00
nobu 1b4df62546 test_fileutils.rb: fix relative symlink path
* 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
2017-02-17 13:31:42 +00:00
nobu c85a58d512 test_fileutils.rb: workaround for Cygwin
* 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
2017-02-17 10:22:10 +00:00
nobu 1ac36ecf00 test_fileutils.rb: cache distinct UIDs
* 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
2017-02-17 10:22:09 +00:00
nobu 3261cfd881 fileutils.rb: do not make root
* 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
2017-02-16 08:42:22 +00:00
kazu 9144d57b94 lib/fileutils.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-07 02:14:07 +00:00
nobu 4aefcbc532 test_fileutils.rb: fix deadlock
* 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
2016-11-24 03:01:59 +00:00
nobu e6efdb7bfd test_fileutils.rb: Use primary group too
* 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
2016-11-23 11:30:02 +00:00
nobu 0785b3e1b7 fileutils.rb: fix error for non-existent entry
* 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
2016-11-04 01:35:49 +00:00
nobu 1e1a114c25 test_fileutils.rb: use Dir.mktmpdir
* 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
2016-09-23 05:27:38 +00:00
nobu 10fcca8f15 FileUtils#install: owner/group options
* 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
2016-06-27 07:55:17 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
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
2015-12-16 05:07:31 +00:00
usa 9fc965eeba * test/fileutils/test_fileutils.rb: add debug output to investigate the 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
2015-12-06 07:22:17 +00:00
nobu 96ff94c95d relax error message format
* 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
2015-10-24 12:16:55 +00:00
nobu 8879d73ffd test: try File.symlink with invalid paths
* test (have_symlink?): try File.symlink with invalid paths to
  test the administrator privilege, nil just raises an
  ArgumentError before trying the actual API.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-29 01:25:07 +00:00
nobu 5dfc455b72 test: File.symlink needs administrator privilege
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-28 01:24:36 +00:00
nobu e0cc69b74e test_fileutils.rb: improve my_rm_rf
* test/fileutils/test_fileutils.rb (my_rm_rf): get rid of special
  chars and remove by rmdir on Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 08:11:58 +00:00
nobu 676fe089bd fileutils.rb: fix error message
* lib/fileutils.rb (FileUtils#mv): show the exact target path in
  the error message instead of the destination parent directory
  name.  patched by João Britto <jabcalves AT gmail.com> at
  [ruby-core:68706].  [Bug #11021]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-01 00:59:14 +00:00
akr fb2008a73a * test/lib/envutil.rb: Moved from test/ruby/.
* test/lib/find_executable.rb: Ditto.

* test/lib/memory_status.rb: Ditto.

* test/lib/test/unit.rb: require envutil.

* test/: Don't require envutil in test files.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13 16:05:37 +00:00
akr 801c8ab026 * test/fileutils/test_fileutils.rb: Use assert_join_threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-11 14:44:18 +00:00
odaira f17b95f21c test/fileutils/test_fileutils.rb: AIX does not allow a sticky bit on a regular file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-01 08:48:17 +00:00
hsbt ac210750df * lib/fileutils.rb: enable to remove with non-owner directory.
[ruby-dev:45976] [Bug #6756]
* test/fileutils/test_fileutils.rb: add testcase for #6756.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-12 04:36:31 +00:00
hsbt c2eac0e78c * lib/fileutils.rb: handle ENOENT error with symlink targeted to
non-exists file. [ruby-dev:45933] [Bug #6716]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-11 07:51:19 +00:00
akr a1afdfeb06 test/fileutils/test_fileutils.rb: Close fds.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-29 12:07:39 +00:00
nagachika bafe3bf3da * test/fileutils/test_fileutils.rb (test_chown_dir_group_ownership_not_recursive):
fix typos on comment.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25 03:51:50 +00:00
hsbt 98fce6fea8 * test/fileutils/test_fileutils.rb (test_chown_R): Add tests for
chown_R. [Feature #9383][ruby-core:59641]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25 00:58:54 +00:00
hsbt d76340fa68 * test/fileutils/test_fileutils.rb: Added recursively chmod tests.
[Feature #9303][ruby-core:59325]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25 00:58:52 +00:00
nobu 4c98e1a2c7 * test/fileutils/test_fileutils.rb: revert r45600.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-16 14:30:21 +00:00
nobu a6abfa2da7 test_fileutils.rb: test :preserve option
* test/fileutils/test_fileutils.rb (test_cp_preserve_permissions):
  should test with setting :preserve option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-16 14:16:19 +00:00
usa 5543a55b52 * test: get rid of warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-11 04:22:34 +00:00
hsbt fa7b849f94 * test/fiddle/test_function.rb: remove unused variables.
* test/fileutils/test_fileutils.rb: ditto.
* test/io/console/test_io_console.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-24 09:12:18 +00:00
nobu 15381aa203 test_fileutils.rb: fix for Mac OS X
* test/fileutils/test_fileutils.rb (test_chown_error): fix for Mac
  OS X, whose getpwnam("") doesn't err.  passwd & group databases
  format is colon-separated, so user & group name can't contain a
  colon.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-25 00:47:21 +00:00
nobu e4d63b4fef test_fileutils.rb: fix test
* test/fileutils/test_fileutils.rb (test_chown_error): splat uids.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-24 15:36:29 +00:00
nobu 7e2269a9ce test_fileutils.rb: tests for chown
* test/fileutils/fileasserts.rb (assert_ownership_user): new
  assertion for user ownership.
* test/fileutils/test_fileutils.rb (test_chown_error),
  (test_chown_without_permission, test_chown_with_root):
  based on the patch by vajrasky (Vajrasky Kok) at
  [ruby-core:59298].  [Feature #9292]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-24 14:20:47 +00:00
nobu 9ef195f8d6 test_fileutils.rb: enclose helper methods
* test/fileutils/test_fileutils.rb: enclose helper methods in a
  module from global functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-24 14:04:35 +00:00
usa 156d7f5f60 * test/fileutils/test_fileutils.rb (setup): should not call
Process.groups for Windows.  get rid of many errors introduced by
  r44364.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-23 20:06:44 +00:00
nobu e6847d1c55 test_fileutils.rb: tests for chown
* test/fileutils/fileasserts.rb (assert_ownership_group): new
  assertion for group ownership.
* test/fileutils/test_fileutils.rb (test_chown{,_verbose,_noop}):
  based on the patch by vajrasky (Vajrasky Kok) at
  [ruby-core:59281].  [Feature #9286]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-23 09:37:23 +00:00
usa 9972c18c12 * test/fileutils/test_fileutils.rb (TestFileUtils#test_rmdir):
FileUtils.rmdir ignores Errno::ENOTEMPTY, so, in such cases, this
  assertion is nonsence.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15 07:32:07 +00:00
knu 3488db9455 * test/fileutils/fileasserts.rb
(Test::Unit::FileAssertions#{assert_filemode,assert_equal_timestamp}):
  New utility assertion methods for testing file modes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-09 09:03:32 +00:00
knu 3ac1eeb34d * test/fileutils/test_fileutils.rb
(TestFileUtils#assert_output_lines): New utility assertion
  method for testing verbose output.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-09 09:03:29 +00:00
knu a6e3d4bea0 * lib/fileutils.rb (FileUtils#mode_to_s): Define mode_to_s() also
as singleton method, or FileUtils.chmod fails in verbose mode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-09 07:02:04 +00:00
knu f5a6a2a7e0 * test/fileutils/fileasserts.rb
(Test::Unit::FileAssertions#assert_not_symlink): Add a missing
  optional argument "message".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-09 07:02:01 +00:00
nobu 9d93d4df6f test/unit: assert_raise_with_message
* lib/test/unit/assertions.rb (assert_raise_with_message): move from
  test/fileutils/test_fileutils.rb.  this is still experimental and
  the interface may be changed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05 02:29:49 +00:00
knu a0011cd54d * lib/fileutils.rb (FileUtils.chmod{,_R}): Enhance the symbolic
mode parser to support the permission symbols u/g/o and multiple
  actions as defined in SUS, so that chmod("g=o+w", file) works as
  expected.  Invalid symbolic modes are now rejected with
  ArgumentError.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-04 17:22:08 +00:00
nobu 4b5267018a fileutils.rb: fix traversal loop
* lib/fileutils.rb (FileUtils#rmdir): fix traversal loop, not trying
  remove same directory only.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13 13:12:35 +00:00
nobu d479419ad3 test_fileutils.rb: parents option
* test/fileutils/test_fileutils.rb (TestFileUtils#test_rmdir): add
  assertions for parents option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13 13:03:30 +00:00
kazu 4a97761c1a add description of test in comment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 11:53:02 +00:00
naruse 0094cd8c64 * test/fileutils/test_fileutils.rb (TestFileUtils#test_mkdir): add
EACCES for Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 00:48:24 +00:00
kazu 5be4642395 add EEXIST for Linux
* test/fileutils/test_fileutils.rb (TestFileUtils#test_mkdir): add
  EEXIST for Linux. (suggested by nurse)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-03 15:46:29 +00:00