Skip to content

Commit f8dba3c

Browse files
committed
Support Ruby 3.5 style Set inspection result
1 parent c469cc5 commit f8dba3c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/block_test.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
end
44

55
require_relative 'test_helper'
6-
require 'set'
76

87
class TestBlockContext < Test::Unit::TestCase
98
include PowerAssertTestHelper
@@ -137,7 +136,19 @@ def Assertion(&blk)
137136
end
138137

139138
t do
140-
assert_equal <<END.chomp, assertion_message {
139+
expected = if RUBY_VERSION >= '3.5'
140+
<<END.chomp
141+
Set.new == Set.new([0])
142+
| | | | |
143+
| | | | Set[0]
144+
| | | Set
145+
| | false
146+
| Set[]
147+
Set
148+
END
149+
else
150+
require "set"
151+
<<END.chomp
141152
Set.new == Set.new([0])
142153
| | | | |
143154
| | | | #<Set: {0}>
@@ -146,6 +157,8 @@ def Assertion(&blk)
146157
| #<Set: {}>
147158
Set
148159
END
160+
end
161+
assert_equal expected, assertion_message {
149162
Set.new == Set.new([0])
150163
}
151164
end

0 commit comments

Comments
 (0)