diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-20 06:54:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-20 06:54:23 +0000 |
commit | 15a98ab42838be248a5b59ca342033ee338357ad (patch) | |
tree | 54d37b82280acbc3dc0dc10017b7470a77135c23 /test | |
parent | d034fcb13f04b096f99d1824d5e7dd8ed256713e (diff) | |
download | ruby-15a98ab42838be248a5b59ca342033ee338357ad.tar.gz |
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')
-rw-r--r-- | test/pathname/test_pathname.rb | 13 |
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 |