Skip to content

Commit d7bf3b2

Browse files
mameko1
authored andcommitted
Support the new message format of NameError in Ruby 3.3
https://bugs.ruby-lang.org/issues/18285#note-38 ``` old: undefined local variable or method `foo' for main:Object new: undefined local variable or method `foo' for main ```
1 parent 0fcfc28 commit d7bf3b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/console/debugger_local_test.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_raised_is_accessible_from_repl
3434
type "catch Exception"
3535
type "c"
3636
type "_raised"
37-
assert_line_text(/undefined local variable or method `foo' for main:Object/)
37+
assert_line_text(/undefined local variable or method `foo' for main/)
3838
type "c"
3939
end
4040
end
@@ -43,7 +43,7 @@ def test_raised_is_accessible_from_command
4343
debug_code(program) do
4444
type "catch Exception pre: p _raised"
4545
type "c"
46-
assert_line_text(/undefined local variable or method `foo' for main:Object/)
46+
assert_line_text(/undefined local variable or method `foo' for main/)
4747
type "c"
4848
end
4949
end
@@ -96,7 +96,7 @@ def test_raised_doesnt_leak_to_program_binding
9696

9797
# stops for NoMethodError because _raised is not defined in the program
9898
type "_raised"
99-
assert_line_text(/undefined local variable or method `_raised' for main:Object/)
99+
assert_line_text(/undefined local variable or method `_raised' for main/)
100100
type "c"
101101
end
102102
end
@@ -155,7 +155,7 @@ def test_raised_doesnt_leak_to_program_binding
155155
type "c"
156156
# stops for NoMethodError because _return is not defined in the program
157157
type "_raised"
158-
assert_line_text(/undefined local variable or method `_return' for main:Object/)
158+
assert_line_text(/undefined local variable or method `_return' for main/)
159159
type "c"
160160
end
161161
end

0 commit comments

Comments
 (0)