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

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
This commit is contained in:
nobu 2013-12-24 14:20:47 +00:00
parent 9ef195f8d6
commit 7e2269a9ce
3 changed files with 94 additions and 1 deletions

View file

@ -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, <<EOT
File user ownership of "#{file}" unexpected:
Expected: <#{expected}>
Actual: <#{actual}>
EOT
end
end