Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when running untracevar with not existing global variable #743

Merged
merged 1 commit into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed

* [#741](https://github.com/deivid-rodriguez/byebug/pull/741): Small consistency issues in help messages.
* [#743](https://github.com/deivid-rodriguez/byebug/pull/743): `untracevar` command crashing when giving a non existent global variable.

### Removed

Expand Down
2 changes: 1 addition & 1 deletion lib/byebug/commands/untracevar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def execute
untrace_var(:"#{var}")
puts pr("trace.messages.undo", var: var)
else
errmsg pr("trace.errors.not_global", var: var)
errmsg pr("trace.errors.var_is_not_global", name: var)
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions test/commands/untracevar_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@ def test_untracevar_help

check_output_includes "Stops tracing a global variable."
end

def test_untracevar_not_global
enter "untracevar $foo"
debug_code(minimal_program)

check_error_includes "'$foo' is not a global variable."
end
end
end