1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-12-25 00:47:21 +00:00
parent a8aefef874
commit 15381aa203

View file

@ -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/) {