diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 00:47:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 00:47:21 +0000 |
commit | 15381aa203915e79cc1329959882605ee1ec7cc3 (patch) | |
tree | 2f3fe8f8071d63bc5f2600f2f21126b04f57902b /test/fileutils | |
parent | a8aefef874711b31cebc03a685b895a00908f737 (diff) | |
download | ruby-15381aa203915e79cc1329959882605ee1ec7cc3.tar.gz |
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
Diffstat (limited to 'test/fileutils')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index e3e3d492cb..24d4f3c566 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -1128,12 +1128,16 @@ class TestFileUtils < Test::Unit::TestCase touch 'tmp/a' - assert_raise_with_message(ArgumentError, "can't find user for ") { - chown '', @groups[0], 'tmp/a' + # getpwnam("") on Mac OS X doesn't err. + # passwd & group databases format is colon-separated, so user & + # group name can't contain a colon. + + assert_raise_with_message(ArgumentError, "can't find user for :::") { + chown ":::", @groups[0], 'tmp/a' } - assert_raise_with_message(ArgumentError, "can't find group for ") { - chown uid, '', 'tmp/a' + assert_raise_with_message(ArgumentError, "can't find group for :::") { + chown uid, ":::", 'tmp/a' } assert_raise_with_message(Errno::ENOENT, /No such file or directory/) { |