From 7e2269a9ce38e3fe9c3b8fd2c469593b60d87263 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 24 Dec 2013 14:20:47 +0000 Subject: test_fileutils.rb: tests for chown * test/fileutils/fileasserts.rb (assert_ownership_user): new assertion for user ownership. * test/fileutils/test_fileutils.rb (test_chown_error), (test_chown_without_permission, test_chown_with_root): based on the patch by vajrasky (Vajrasky Kok) at [ruby-core:59298]. [Feature #9292] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/fileutils/fileasserts.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/fileutils/fileasserts.rb') diff --git a/test/fileutils/fileasserts.rb b/test/fileutils/fileasserts.rb index 2cc7e2316b..b6067f6d84 100644 --- a/test/fileutils/fileasserts.rb +++ b/test/fileutils/fileasserts.rb @@ -95,6 +95,15 @@ EOT File group ownership of "#{file}" unexpected: Expected: <#{expected}> Actual: <#{actual}> +EOT + end + + def assert_ownership_user(expected, file) + actual = File.stat(file).uid + assert expected == actual, < + Actual: <#{actual}> EOT end end -- cgit v1.2.3