[ruby/pp] [Feature #21389] Update rubyspec

This commit is contained in:
Nobuyoshi Nakada 2025-10-05 20:12:35 +09:00
parent 674e2ca945
commit ab49e8a0f0
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2025-10-05 12:00:47 +00:00

View File

@ -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("#<Set: {...}>")
ruby_version_is(""..."3.5") do
pp.should_receive(:text).with("#<Set: {...}>")
end
ruby_version_is("3.5") do
pp.should_receive(:text).with("Set[...]")
end
Set[1, 2, 3].pretty_print_cycle(pp)
end
end