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

111 Коммитов

Автор SHA1 Сообщение Дата
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
kazu 1739ecda3b FileUtils.rmdir use remove_tailing_slash
* lib/fileutils.rb (FileUtils.rmdir): use remove_tailing_slash.
* test/fileutils/test_fileutils.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-03 15:01:42 +00:00
ayumin cef3f2ebd4 * lib/fileutils.rb: fix behavior when mkdir/mkdir_p accepted "/".
* test/fileutils/test_fileutils.rb: add test for above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-03 14:20:15 +00:00
drbrain 874f8c0494 * lib/fileutils.rb: Revert r34669 which altered the way
metaprogramming in FileUtils occurred.  [ruby-trunk - Bug #7958]

* test/fileutils/visibility_tests.rb:  Refactored tests of FileUtils
  options modules to expose bug found in #7958
* test/fileutils/test_dryrun.rb:  ditto.
* test/fileutils/test_nowrite.rb:  ditto.
* test/fileutils/test_verbose.rb:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-01 02:09:42 +00:00
mame 7dc77be299 * lib/fileutils.rb (copy_entry, wrap_traverse): preserve attributes of
directories on FileUtils.cp_r.  The fix was proposed by Jan
  Wedekind.  [Bug #7246]

* test/fileutils/test_fileutils.rb: add a test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-02 03:54:00 +00:00
mame 4077b9b89d * lib/fileutils.rb: chmod/chmod_R with a string mode (e.g., "+x")
caused error in verbose mode.

* test/fileutils/test_fileutils.rb: add a test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-02 03:07:17 +00:00
eregon d4c84d175e make FileUtils tests safe when interrupting in setup
* test/fileutils/test_fileutils.rb (TestFileUtils#teardown):
  do not assume cwd is TMPROOT and never remove current directory.
  [ruby-core:47224][Bug #6884]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-21 11:32:18 +00:00
ayumin d570a76cba * test/fileutils/test_fileutils.rb: add test for FileUtils#uptodate?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-16 08:15:08 +00:00
nobu 298258891d use assert_equal, assert_match, and so on.
* test/fileutils/fileasserts.rb: use assert_equal, assert_match, and so on.
* test/ruby/enc/test_utf16.rb, test/ruby/enc/test_utf32.rb,
  test/ruby/test_io_m17n.rb (assert_str_equal): ditto.
* test/rubygems/test_gem_remote_fetcher.rb
  (assert_data_from_{server,proxy}): ditto.
* test/test_pstore.rb (test_thread_safe): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 01:23:07 +00:00
akr 52af87a5a7 add an assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-30 14:45:31 +00:00
akr 7d89ecdc52 * lib/fileutils.rb (copy_metadata): use File.lchown and File.lchmod to
update meta data of symlinks.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-30 14:37:54 +00:00
tenderlove ace46301d8 * lib/fileutils.rb: refactored FileUtil methods to use the
`define_command` API.  Patch from 7rans <transfire@gmail.com>
* test/fileutils/test_dryrun.rb: corresponding test refactoring
* test/fileutils/test_nowrite.rb: ditto
* test/fileutils/test_verbose.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 17:59:47 +00:00
ngoto 8b8c7fd386 * test/fileutils/test_fileutils.rb (test_chmod_symbol_mode): Solaris
seems to behave the same as FreeBSD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 16:41:12 +00:00
naruse d7138d72db * test/fileutils/test_fileutils.rb: add OpenBSD case.
patched by Jeremy Evans [ruby-core:38530] see #5097

* test/ruby/test_process.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 15:30:11 +00:00
naruse 4de27b35b5 NetBSD also denies to set sticky bit against regular file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29 17:01:27 +00:00
kosaki 50522eb351 * test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
Skip sticky bit test if the platform is FreeBSD. It doesn't allow to
  change sticky bit if a target is regular file.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-03 11:31:20 +00:00
kosaki 0a1e7d1568 * lib/fileutils.rb (FileUtils#chmod): accept symbolic mode argument.
The patch was written by takkanm. [ruby-core:26029][Feature #2190]

* lib/fileutils.rb (FileUtils#fu_mode): new helper function.
* lib/fileutils.rb (FileUtils#symbolic_modes_to_i): ditto.
* lib/fileutils.rb (FileUtils#mode_mask): ditto.
* lib/fileutils.rb (FileUtils#user_mask): ditto.

* test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
  new test for the above symbolic mode.
* test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_R): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-01 16:16:05 +00:00
nobu c7837ed8d3 * lib/fileutils.rb (FileUtils::Entry_#copy_file): updated FileUtils.cp
to still copy file permissions when :preserve is false (as cp does
  this even when -p isn't set).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-17 23:48:13 +00:00
nobu 58195557b2 * test/fileutils/fileasserts.rb (FileAssertions): separate module.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-06 03:13:08 +00:00
nobu dd9341f02b * lib/test/unit/assertions.rb (assert_block): move from
test/fileutils/fileasserts.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-05 12:22:27 +00:00