diff options
author | Justin Collins <justin@presidentbeef.com> | 2016-09-11 02:09:43 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-06 09:01:04 +0900 |
commit | 4f1a00a746b8c47dd32f06b249aad8c4d27cb934 (patch) | |
tree | 56aa77ce552f4f001410423a76bffdad075781fa /test/fileutils | |
parent | 96cec6b27741cbdeb51ea3acdeba0e813d51035f (diff) | |
download | ruby-4f1a00a746b8c47dd32f06b249aad8c4d27cb934.tar.gz |
Improve same directory detection in FileUtils
Closes: https://github.com/ruby/ruby/pull/1425
Diffstat (limited to 'test/fileutils')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index c81f5b40dc..18a4bed39e 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -381,6 +381,16 @@ class TestFileUtils < Test::Unit::TestCase assert_same_file 'tmp/cpr_src/b', 'tmp/cpr_dest/b' assert_same_file 'tmp/cpr_src/c', 'tmp/cpr_dest/c' assert_directory 'tmp/cpr_dest/d' + assert_raise(ArgumentError) do + cp_r 'tmp/cpr_src', './tmp/cpr_src' + end + assert_raise(ArgumentError) do + cp_r './tmp/cpr_src', 'tmp/cpr_src' + end + assert_raise(ArgumentError) do + cp_r './tmp/cpr_src', File.expand_path('tmp/cpr_src') + end + my_rm_rf 'tmp/cpr_src' my_rm_rf 'tmp/cpr_dest' |