summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-08-13 23:11:34 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-08-13 23:15:52 +0900
commitc095736002e72d8f00c2c09b0295d2630e4375c7 (patch)
treedb5fa3e822f22fbfa79c25062842823f6637241e /mrbgems/mruby-io/test
parent14206a75a37020a3a4926b1289a1f07277b78578 (diff)
downloadmruby-c095736002e72d8f00c2c09b0295d2630e4375c7.tar.gz
mruby-c095736002e72d8f00c2c09b0295d2630e4375c7.zip
Try to fix a fragile `File#mtime` test.
Diffstat (limited to 'mrbgems/mruby-io/test')
-rw-r--r--mrbgems/mruby-io/test/file.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/mrbgems/mruby-io/test/file.rb b/mrbgems/mruby-io/test/file.rb
index ab4678fe9..ca285f5bd 100644
--- a/mrbgems/mruby-io/test/file.rb
+++ b/mrbgems/mruby-io/test/file.rb
@@ -73,12 +73,12 @@ assert('File#mtime') do
skip "File#mtime require Time"
end
begin
- now = Time.now.to_i
- mt = 0
File.open("#{$mrbtest_io_wfname}.mtime", 'w') do |f|
- mt = f.mtime.to_i
+ assert_equal Time, f.mtime.class
+ File.open("#{$mrbtest_io_wfname}.mtime", 'r') do |f2|
+ assert_equal true, f.mtime == f2.mtime
+ end
end
- assert_equal true, mt >= now
ensure
File.delete("#{$mrbtest_io_wfname}.mtime")
end