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

Removed double assignment of same local variable #356

Closed
wants to merge 1 commit into from
Closed

Removed double assignment of same local variable #356

wants to merge 1 commit into from

Conversation

bcardarella
Copy link
Contributor

I saw this was part of a warning clean up for Ruby 1.9.3 that @tenderlove did. If this is necessary I'd love to be enlightened as to why it is causing warnings :)

@tenderlove
Copy link
Member

1.9.3 emits warnings for variables that are not used. These warnings happen at parse time, so ruby cannot consider eval'd strings. In this case, the variable is used in an evaled string. A cheap way to avoid the warning in this case is the double assignment.

Probably a better solution would be to make assert_difference take a lambda. Then we can remove the double assignment, avoid eval, and eliminate the warning.

@tenderlove tenderlove closed this May 1, 2011
matthewd pushed a commit that referenced this pull request Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants