diff options
Diffstat (limited to 'test/60-comirror-setup.t')
-rwxr-xr-x | test/60-comirror-setup.t | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/test/60-comirror-setup.t b/test/60-comirror-setup.t index 5f61969..3efdcaf 100755 --- a/test/60-comirror-setup.t +++ b/test/60-comirror-setup.t @@ -13,6 +13,19 @@ my $next_base = 'file://' . getcwd() . '/test/next-loop'; my ($str, $exit); my @links; +sub check_key { + my ($filetype, $key, $value) = @_; + my @lines; + $test->read(\@lines, "comirror.${filetype}"); + + if(grep { $_ eq "$key\t$value\n" } @lines) { + pass("${filetype}: ${key} = ${value}"); + } + else { + fail("${filetype}: ${key} = ${value}"); + } +} + ok($test, 'Create Test::Cmd object'); $exit = $test->run( @@ -38,8 +51,6 @@ ok($exit == 0, 'Correct usage: return zero'); isnt($test->stdout, q{}, 'Correct usage: Something to stdout'); is ($test->stderr, q{}, 'Correct usage: Nothing to stderr'); -$test->read(\$str, 'last_uri'); -is($str, "$links[0]\n", 'Correct last_uri'); +check_key('state', 'uri', $links[0]); -$test->read(\$str, 'image_re'); -is($str, "${next_base}/.+\n", 'Correct image_re'); +check_key('conf', 'image_re', "${next_base}/.+"); |