From 20d7db8cbaa617f58d0d262c354c76460a6ad809 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 2 Jun 2025 08:50:54 +0900 Subject: [PATCH] Handle test failure of mock object Fixup 4c26a38ed3c https://rubyci.s3.amazonaws.com/amazon2/ruby-master/log/20250601T213003Z.fail.html.gz ``` 1) An exception occurred during: Mock.verify_count File.birthtime accepts an object that has a #to_path method FAILED Mock 'path' expected to receive to_path(:any_args) exactly 1 times but received it 0 times /home/chkbuild/chkbuild/tmp/build/20250601T213003Z/ruby/spec/ruby/core/file/birthtime_spec.rb:4:in 'block in ' /home/chkbuild/chkbuild/tmp/build/20250601T213003Z/ruby/spec/ruby/core/file/birthtime_spec.rb:3:in '' ``` --- spec/ruby/core/file/birthtime_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/ruby/core/file/birthtime_spec.rb b/spec/ruby/core/file/birthtime_spec.rb index a8a102e93e..eb769f67ff 100644 --- a/spec/ruby/core/file/birthtime_spec.rb +++ b/spec/ruby/core/file/birthtime_spec.rb @@ -18,6 +18,7 @@ platform_is :windows, :darwin, :freebsd, :netbsd, :linux do end it "accepts an object that has a #to_path method" do + File.birthtime(@file) # Avoid to failure of mock object with old Kernel and glibc File.birthtime(mock_to_path(@file)) rescue NotImplementedError => e skip e.message if e.message.start_with?("birthtime() function")