aboutsummaryrefslogtreecommitdiffstats
path: root/test/pathname/test_pathname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/pathname/test_pathname.rb')
-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