File: remove.t

package info (click to toggle)
libconfigreader-simple-perl 1.28-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 212 kB
  • ctags: 27
  • sloc: perl: 696; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 592 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use Test::More tests => 5;

use ConfigReader::Simple;

my @Directives = qw( Test1 Test2 Test3 Test4 );

my $config = ConfigReader::Simple->new( "t/example.config", \@Directives );
isa_ok( $config, 'ConfigReader::Simple' );

# remove things that do exist
is( $config->get( 'Test3' ), 'foo', 'Test3 has the right value' );
ok( $config->remove( 'Test3' ), 'Test3 is removed' );

my $value =  not $config->exists( 'Test3' );
ok( $value, 'Test3 no longer exists' );

# remove things that do not exist
$value = not $config->remove( 'Tenor' );
ok( $value, 'Tenor does not exist, but was removed' );