Skip to content

Commit 9b8778a

Browse files
committed
fix: monkey patch file gem for rspec
1 parent 262feb7 commit 9b8778a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

spec/spec_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
require_relative 'support/file_exists_patch'
4+
15
if ENV['COVERAGE']
26
require 'coveralls'
37
require 'codeclimate-test-reporter'

spec/support/file_exists_patch.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
# Monkey patch to add back File.exists? for compatibility with the files gem
4+
# This is needed because File.exists? was removed in Ruby 3.2
5+
class File
6+
class << self
7+
alias exists? exist?
8+
end
9+
end

0 commit comments

Comments
 (0)