From 8d0e0b4b1070aabbaf4543de0391f441a3dfa2da Mon Sep 17 00:00:00 2001 From: johnnyshields <27655+johnnyshields@users.noreply.github.com> Date: Mon, 12 May 2025 15:49:28 +0900 Subject: [PATCH] Fix DocumentNotFound spec on Ruby 3.4 --- spec/mongoid/errors/document_not_found_spec.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/spec/mongoid/errors/document_not_found_spec.rb b/spec/mongoid/errors/document_not_found_spec.rb index 2bf9b302b8..803a7ed5a0 100644 --- a/spec/mongoid/errors/document_not_found_spec.rb +++ b/spec/mongoid/errors/document_not_found_spec.rb @@ -64,9 +64,15 @@ end it "contains the problem in the message" do - expect(error.message).to include( - "Document not found for class Person with attributes {:name=>\"syd\"}." - ) + if RUBY_VERSION >= '3.4.0' + expect(error.message).to include( + 'Document not found for class Person with attributes {name: "syd"}.' + ) + else + expect(error.message).to include( + 'Document not found for class Person with attributes {:name=>"syd"}.' + ) + end end it "contains the summary in the message" do