about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-09-03 19:35:46 +0000
committerEric Wong <normalperson@yhbt.net>2013-09-03 19:36:36 +0000
commitdae148a9d6de7501acf8a68218b3e9d2c5ff6ff7 (patch)
tree659d2f17f71307adb8d5a02dc4f16db7eff6bcf8
parent5c99abe6108d8d6a52c07b969afbc556c59b33be (diff)
downloadkgio-dae148a9d6de7501acf8a68218b3e9d2c5ff6ff7.tar.gz
This fails when the test is run as root (which may be the case
of some Ruby installations) or fakeroot (which is the case of
Debian build systems).
-rw-r--r--test/test_tryopen.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test_tryopen.rb b/test/test_tryopen.rb
index 8a8278c..abcbd37 100644
--- a/test/test_tryopen.rb
+++ b/test/test_tryopen.rb
@@ -30,7 +30,12 @@ class TestTryopen < Test::Unit::TestCase
     tmp = Tempfile.new "tryopen"
     File.chmod 0000, tmp.path
     tmp = Kgio::File.tryopen(tmp.path)
-    assert_equal(:EACCES, tmp)
+    if Process.euid == 0
+      assert_kind_of Kgio::File, tmp
+      warn "cannot test EACCES when euid == 0"
+    else
+      assert_equal(:EACCES, tmp)
+    end
   end
 
   def test_tryopen_readwrite