Skip to content

Commit 20d7db8

Browse files
committed
Handle test failure of mock object
Fixup 4c26a38 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 <top (required)>' /home/chkbuild/chkbuild/tmp/build/20250601T213003Z/ruby/spec/ruby/core/file/birthtime_spec.rb:3:in '<top (required)>' ```
1 parent 3fd2d54 commit 20d7db8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

spec/ruby/core/file/birthtime_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
end
1919

2020
it "accepts an object that has a #to_path method" do
21+
File.birthtime(@file) # Avoid to failure of mock object with old Kernel and glibc
2122
File.birthtime(mock_to_path(@file))
2223
rescue NotImplementedError => e
2324
skip e.message if e.message.start_with?("birthtime() function")

0 commit comments

Comments
 (0)