From 15381aa203915e79cc1329959882605ee1ec7cc3 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 25 Dec 2013 00:47:21 +0000 Subject: 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 --- test/fileutils/test_fileutils.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/fileutils') 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/) { -- cgit v1.2.3