diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-04-14 08:52:04 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-04-14 08:52:04 -0500 |
commit | 1db37bb0163fbb33801f8f66ba409a8202137508 (patch) | |
tree | 0b608aaf976f097f63d65204a457ded3b9f006b3 /lib | |
parent | fddf32a172ddc7588fa8818938b17e468ae9de09 (diff) | |
download | app-termcast-1db37bb0163fbb33801f8f66ba409a8202137508.tar.gz app-termcast-1db37bb0163fbb33801f8f66ba409a8202137508.zip |
override termsize calculation in tests, so it is consistent
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/Termcast.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index c4d0293..d2fff29 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -130,10 +130,14 @@ sub _build_establishment_message { return sprintf("hello %s %s\n", $self->user, $self->password); } +sub _termsize { + return try { GetTerminalSize() } catch { (undef, undef) }; +} + sub termsize_message { my $self = shift; - my ($cols, $lines) = try { GetTerminalSize() }; + my ($cols, $lines) = $self->_termsize; return '' unless $cols && $lines; |