From 1db37bb0163fbb33801f8f66ba409a8202137508 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 14 Apr 2011 08:52:04 -0500 Subject: override termsize calculation in tests, so it is consistent --- lib/App/Termcast.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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; -- cgit v1.2.3-54-g00ecf