The method #initialize_copy should be private, no direct call

Fixed test/t/array.rb and test/t/string.rb in standard tests.
And mrbgems/mruby-struct/test/struct.rb as well.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-06-14 13:34:47 +09:00
parent bf0f37833d
commit ebd9f29b38
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ assert("Struct#initialize_copy requires struct to be the same type") do
Struct.__send__(:remove_const,:Test)
Struct.new("Test", :a, :b)
assert_raise(TypeError) do
a.initialize_copy(Struct::Test.new("a", "b"))
a.__send__(:initialize_copy, Struct::Test.new("a", "b"))
end
ensure
Struct.__send__(:remove_const,:Test)
+1 -1
View File
@@ -208,7 +208,7 @@ end
assert('Array#initialize_copy', '15.2.12.5.16') do
a = [1,2,3]
b = [].initialize_copy(a)
b = [].__send__(:initialize_copy, a)
assert_equal([1,2,3], b)
end
+1 -1
View File
@@ -494,7 +494,7 @@ end
assert('String#initialize_copy', '15.2.10.5.24') do
a = ''
a.initialize_copy('abc')
a.__send__(:initialize_copy, 'abc')
assert_equal 'abc', a
end