From f611e5bf9bf8e4b1db93e549020e14c19690ca39 Mon Sep 17 00:00:00 2001 From: Tim Riley Date: Fri, 5 Jan 2024 17:16:36 +1100 Subject: [PATCH] Fix test for Ruby 3.3 This test relied on an assumption that is no longer true in 3.3. --- spec/dry/types/default_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/dry/types/default_spec.rb b/spec/dry/types/default_spec.rb index fed2c4f9..26763b5f 100644 --- a/spec/dry/types/default_spec.rb +++ b/spec/dry/types/default_spec.rb @@ -216,6 +216,13 @@ context "proc w/o source" do let(:value_constructor) { method(:Integer).to_proc } + before do + # Force the source_location to nil, since this specific object's source_location returns a + # real value since Ruby 3.3: + # ["", 305] + allow(value_constructor).to receive(:source_location) { nil } + end + it "returns string representation of the type" do expect(type.to_s).to eql( "# "\