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 short-circuit return in Wrong::FailureMessage::wrap_and_indent, t… #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonswar
Copy link

@jonswar jonswar commented May 22, 2015

Add short-circuit return in Wrong::FailureMessage::wrap_and_indent, to prevent infinite loop in environments where the width of Wrong::Terminal.size is incorrectly set to 0 (or <=6).

The infinite loop can be reproduced with:

#!/usr/bin/env ruby
require 'wrong/assert'
include Wrong::Assert
ENV['COLUMNS'] = '6'
f = "aaaaa"
assert { f.nil? }

Yes, most terminal widths shouldn't be set to 0, but in my case a combination of iterm + emacs caused it to be so.

…o prevent infinite loop in environments where the width of Wrong::Terminal.size is incorrectly set to 0 (or <=6)
@kaorukobo
Copy link

Thank you for the great library and jonswar's helpful patch.
On my RubyMine's runner, it caused the same infinite loop and jonswar's patch solved the problem.
I hope this PR will be accepted and the gem will be bumped to 0.7.2.

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.

2 participants