From dae148a9d6de7501acf8a68218b3e9d2c5ff6ff7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 3 Sep 2013 19:35:46 +0000 Subject: [PATCH] test_tryopen: skip EACCES test when euid == 0 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). --- test/test_tryopen.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.11.4.GIT