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:
parent
a8aefef874
commit
15381aa203
1 changed files with 8 additions and 4 deletions
|
@ -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/) {
|
||||
|
|
Loading…
Add table
Reference in a new issue