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

Add tests for watch command #41

Merged
merged 1 commit into from May 31, 2021
Merged

Add tests for watch command #41

merged 1 commit into from May 31, 2021

Conversation

st0012
Copy link
Member

@st0012 st0012 commented May 29, 2021

I found several things when playing with the watch command:

  • It mainly uses line events to detect the change instead of the return events (I'm not sure why though). This causes the program to always stop a line after the change. So in tests we need to add an extra line after the changed line. Otherwise it doesn't stop.
  • It always evaluates the expression from top-level scope. So it's not able to track an instance variable inside an object like watch @name and users need to use watch obj.name instead. I think we should improve this.

But before we do anything on it, we should have some test cases to check its behavior. That's why I open this PR.

@ko1
Copy link
Collaborator

ko1 commented May 31, 2021

Thanks.
Please file an issue for other points.

@ko1 ko1 merged commit f05b942 into ruby:master May 31, 2021
@st0012 st0012 deleted the add-watch-test branch May 31, 2021 04:23
@st0012 st0012 mentioned this pull request May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants