summaryrefslogtreecommitdiff
path: root/test/fileutils/fileasserts.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-23 09:37:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-23 09:37:23 +0000
commite6847d1c559c00f2dcf7d9d3a2e1db56dcecfbaa (patch)
tree0b49f528b89c964229a7392a9c0779ec0db10145 /test/fileutils/fileasserts.rb
parentbc159ec502dd62f2b194c25357fd9f694b5f3f99 (diff)
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
Diffstat (limited to 'test/fileutils/fileasserts.rb')
-rw-r--r--test/fileutils/fileasserts.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/fileutils/fileasserts.rb b/test/fileutils/fileasserts.rb
index c60606ee7f..2cc7e2316b 100644
--- a/test/fileutils/fileasserts.rb
+++ b/test/fileutils/fileasserts.rb
@@ -88,6 +88,15 @@ File modes expected to be equal:
<#{'%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
end
end