From 8730ca135511113f27e5a0a06e939e0fbfba3259 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 20 Nov 2024 21:45:58 +0000 Subject: [PATCH 1/2] Dup string to avoid future frozen value from symbols --- lib/rspec/core/drb.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec/core/drb.rb b/lib/rspec/core/drb.rb index e44db97c3b..31bfbf6530 100644 --- a/lib/rspec/core/drb.rb +++ b/lib/rspec/core/drb.rb @@ -91,7 +91,7 @@ def add_full_description(argv) def add_filter(argv, name, hash) hash.each_pair do |k, v| next if CONDITIONAL_FILTERS.include?(k) - tag = name == :inclusion ? k.to_s : "~#{k}".dup + tag = name == :inclusion ? k.to_s.dup : "~#{k}".dup tag << ":#{v}" if v.is_a?(String) argv << "--tag" << tag end unless hash.empty? From d02e1b49db224a6698b7ebd8e6bff4b82d354d6c Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 20 Nov 2024 21:56:29 +0000 Subject: [PATCH 2/2] Remove blank lines from syntax suggest output --- spec/integration/spec_file_load_errors_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/integration/spec_file_load_errors_spec.rb b/spec/integration/spec_file_load_errors_spec.rb index 435d2ff26f..609d0e04ee 100644 --- a/spec/integration/spec_file_load_errors_spec.rb +++ b/spec/integration/spec_file_load_errors_spec.rb @@ -222,9 +222,9 @@ def foo While loading ./broken_file a `raise SyntaxError` occurred, RSpec will now quit. EOS - # A fix was backported to 3.2.3 + # There was a fix was backported in 3.2.3, but syntax changed in 3.4.0 in terms of line endings if RUBY_VERSION > '3.2.2' - expect(formatted_output).to include unindent(<<-EOS) + expect(formatted_output.gsub(/\n\n/, "\n")).to include unindent(<<-EOS) SyntaxError: --> ./tmp/aruba/broken_file.rb Unmatched keyword, missing `end' ?