From 647ffbb6fbd7fd4f77cbce251c83b8a07cdf4ba4 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 17 Jul 2015 15:59:41 +0300 Subject: [PATCH] Add a test for delete_hook --- t/01-constants.t | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/01-constants.t b/t/01-constants.t index 22ef038..b68d349 100644 --- a/t/01-constants.t +++ b/t/01-constants.t @@ -4,7 +4,7 @@ use warnings; use lib 't'; use File::Temp qw/tempfile/; -use Test::More tests => 19; +use Test::More tests => 20; our ($section_1, $section_2, $section_3, $section_4, %options); @@ -30,6 +30,9 @@ sub run_parser { section_2 => \$section_2, section_3 => sub { tr/[a-z]/[A-Z]/; $section_3 = $_ }, section_4 => sub { eval }, + 'GUI parameters' => sub { + Pod::Constants::delete_hook('*item') + }, 'command line parameters' => sub { Pod::Constants::add_hook('*item' => \&handle_item) }); @@ -96,6 +99,7 @@ $TestManPage::myvar = $TestManPage::html = undef; @TestManPage::myarray = (); is $options{foo}->{options}->[0], "-f", "Pod::Constants::add_hook"; +ok !exists $options{gtk}, 'Pod::Constants::remove_hook'; =head2 section_1 @@ -127,4 +131,16 @@ This does something cool. This also does something pretty cool. +=head1 GUI parameters + +the following GUI parameters are supported + +=item -g, --gtk + +Use a GTK+ look-and-feel + +=item -q, --qt + +Use a Qt look-and-feel + =cut -- 2.39.2