summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io/test/file.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-08-13 23:11:34 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-08-25 09:19:17 +0900
commita16885efe5125944316b48c644c3a9eae2fc568e (patch)
treeae6ad17b4f9af7ed725736fb8931e7d3101c629c /mrbgems/mruby-io/test/file.rb
parent31827189ab98a4e51c84772fd782627fc8feb8cc (diff)
downloadmruby-a16885efe5125944316b48c644c3a9eae2fc568e.tar.gz
mruby-a16885efe5125944316b48c644c3a9eae2fc568e.zip
Try to fix a fragile `File#mtime` test.
Diffstat (limited to 'mrbgems/mruby-io/test/file.rb')
-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