diff --git a/spec/ruby/core/set/pretty_print_cycle_spec.rb b/spec/ruby/core/set/pretty_print_cycle_spec.rb index c3b383fe80..d4cca515e2 100644 --- a/spec/ruby/core/set/pretty_print_cycle_spec.rb +++ b/spec/ruby/core/set/pretty_print_cycle_spec.rb @@ -3,7 +3,12 @@ require_relative '../../spec_helper' describe "Set#pretty_print_cycle" do it "passes the 'pretty print' representation of a self-referencing Set to the pretty print writer" do pp = mock("PrettyPrint") - pp.should_receive(:text).with("#") + ruby_version_is(""..."3.5") do + pp.should_receive(:text).with("#") + end + ruby_version_is("3.5") do + pp.should_receive(:text).with("Set[...]") + end Set[1, 2, 3].pretty_print_cycle(pp) end end