Skip to content

Commit fb16db3

Browse files
committed
Fix method definition owners
ruby/ruby@e22d5c2
1 parent 9cd14c5 commit fb16db3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/test_error_highlight.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,12 +1362,12 @@ def test_errors_on_terminal_window_smaller_than_min_width
13621362

13631363
warning = nil
13641364
original_warn = Warning.method(:warn)
1365-
Warning.define_singleton_method(:warn) {|s| warning = s}
1365+
Warning.define_method(:warn) {|s| warning = s}
13661366
begin
13671367
ErrorHighlight::DefaultFormatter.max_snippet_width = custom_max_width
13681368
ensure
1369-
Warning.singleton_class.remove_method(:warn)
1370-
Warning.define_singleton_method(:warn, original_warn)
1369+
Warning.remove_method(:warn)
1370+
Warning.define_method(:warn, original_warn)
13711371
end
13721372
assert_match "'max_snippet_width' adjusted to minimum value of #{min_snippet_width}", warning
13731373

0 commit comments

Comments
 (0)