diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-24 14:20:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-24 14:20:47 +0000 |
commit | 7e2269a9ce38e3fe9c3b8fd2c469593b60d87263 (patch) | |
tree | 30d9cda9f0e7d52c4dd140368ed4ef9e4dcbd82a /test/fileutils/fileasserts.rb | |
parent | 9ef195f8d649819d56266a0078ebd7fb90ed0762 (diff) | |
download | ruby-7e2269a9ce38e3fe9c3b8fd2c469593b60d87263.tar.gz |
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
Diffstat (limited to 'test/fileutils/fileasserts.rb')
-rw-r--r-- | test/fileutils/fileasserts.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ -97,6 +97,15 @@ File group ownership of "#{file}" unexpected: Actual: <#{actual}> EOT end + + def assert_ownership_user(expected, file) + actual = File.stat(file).uid + assert expected == actual, <<EOT +File user ownership of "#{file}" unexpected: + Expected: <#{expected}> + Actual: <#{actual}> +EOT + end end end end |