|
#!/perl
my $expected_content = "<title>Google</title>" ;
ok( my $fetch = App::Wubot::Reactor::WebFetch->new(),
"Creating new WebFetch reactor object"
);
{
ok( my $results = $fetch ->react( { title => 'test' },
field => 'body' ,
} ),
"Calling fetch for 'body' field from google"
);
like( $results ->{body},
qr/$expected_content/ i,
"Checking that body field contains google content"
);
}
{
ok( my $results = $fetch ->react( { title => 'test' ,
},
{ url_field => 'myurl' ,
field => 'body' ,
} ),
"Calling fetch for 'body' field from url on field myurl"
);
like( $results ->{body},
qr/$expected_content/ i,
"Checking that body field contains google content"
);
}
|