From 4dc3ce02f25e87db1fb49cd0b5269bcefee09e78 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Tue, 13 Feb 2024 10:39:55 -0500 Subject: [PATCH 1/2] Test with ruby 3.1 and 3.0 --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cd0a933..abb0e2f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,7 @@ jobs: matrix: ruby-version: - '3.0' + - '3.1' env: CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}" steps: From aa00e813432076cde540bdbd9a0f467eda9df08f Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Tue, 13 Feb 2024 11:35:51 -0500 Subject: [PATCH 2/2] Monkey patch Camcorder gem to support psych 4+ --- spec/support/camcorder_helper.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/support/camcorder_helper.rb b/spec/support/camcorder_helper.rb index c33709b..a3698bc 100644 --- a/spec/support/camcorder_helper.rb +++ b/spec/support/camcorder_helper.rb @@ -35,4 +35,17 @@ def self.deintercept_all @intercepted_constructors = [] end private_class_method :deintercept_all + + class Recorder + def start + if File.exists?(filename) + contents = File.read(filename) + @recordings = YAML.respond_to?(:safe_load) ? YAML.safe_load(contents, :permitted_classes => [Camcorder::Recording, Symbol]) : YAML.load(contents) + @replaying = true + else + @recordings = {} + @replaying = false + end + end + end end