--- google/t/20-response.t 2007/06/19 19:36:21 45
+++ google/t/20-response.t 2007/06/19 22:06:46 53
@@ -4,7 +4,7 @@
my $debug = shift @ARGV;
-use Test::More tests => 5;
+use Test::More tests => 9;
use Data::Dump qw/dump/;
use blib;
@@ -18,17 +18,53 @@
ok( my $response = CWMP::Response->new({ debug => $debug }), 'new' );
isa_ok( $response, 'CWMP::Response' );
-ok( my $inform = $response->Inform({ ID => 42 }), 'Inform' );
+sub is_like {
+ my ( $command, $template_xml ) = @_;
-like( $inform, qr{\Q
+ ok( my $xml = $response->$command({ ID => 42 }), $command );
+ diag $xml if $debug;
+ chomp( $xml );
+ chomp( $template_xml );
+ like( $xml, qr{^\Q$template_xml\E$}, $command . ' xml' );
+}
+
+is_like( 'Inform', <<__SOAP__
+
42
+ 0
1
-\E}, 'xml');
+
+__SOAP__
+);
-diag $inform if $debug;
+is_like( 'GetRPCMethods', <<__SOAP__
+
+
+ 42
+ 0
+
+
+
+
+
+__SOAP__
+);
+
+is_like( 'Reboot', <<__SOAP__
+
+
+ 42
+ 0
+
+
+
+
+
+__SOAP__
+);