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_group): new
  assertion for group ownership.
* test/fileutils/test_fileutils.rb (test_chown{,_verbose,_noop}):
  based on the patch by vajrasky (Vajrasky Kok) at
  [ruby-core:59281].  [Feature #9286]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-23 09:37:23 +00:00
parent bc159ec502
commit e6847d1c55
3 changed files with 63 additions and 1 deletions

View file

@ -86,6 +86,15 @@ EOT
File modes expected to be equal:
<#{'%0*o' % [width, mode1]}>: "#{file1}"
<#{'%0*o' % [width, mode2]}>: "#{file2}"
EOT
end
def assert_ownership_group(expected, file)
actual = File.stat(file).gid
assert expected == actual, <<EOT
File group ownership of "#{file}" unexpected:
Expected: <#{expected}>
Actual: <#{actual}>
EOT
end
end