summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-20 06:54:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-20 06:54:23 +0000
commit15a98ab42838be248a5b59ca342033ee338357ad (patch)
tree54d37b82280acbc3dc0dc10017b7470a77135c23 /test/pathname
parentd034fcb13f04b096f99d1824d5e7dd8ed256713e (diff)
Try statx syscall
* file.c (rb_file_s_birthtime): export for pathname to check if birthtime is supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname')
-rw-r--r--test/pathname/test_pathname.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index f8e4937802..78f0af71df 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -789,10 +789,15 @@ class TestPathname < Test::Unit::TestCase
end
def test_birthtime
- assert_kind_of(Time, Pathname(__FILE__).birthtime)
- rescue NotImplementedError
- assert_raise(NotImplementedError) do
- File.birthtime(__FILE__)
+ # Check under a (probably) local filesystem.
+ # Remote filesystems often may not support birthtime.
+ with_tmpchdir('rubytest-pathname') do |dir|
+ open("a", "w") {}
+ assert_kind_of(Time, Pathname("a").birthtime)
+ rescue NotImplementedError
+ assert_raise(NotImplementedError) do
+ File.birthtime("a")
+ end
end
end