Skip to content

Commit

Permalink
better response tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 24, 2012
1 parent 7503128 commit 5e85909
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions t/mojo/response.t
@@ -1,6 +1,6 @@
use Mojo::Base -strict;

use Test::More tests => 372;
use Test::More tests => 373;

# "Quick Smithers. Bring the mind eraser device!
# You mean the revolver, sir?
Expand Down Expand Up @@ -723,14 +723,16 @@ is $res->version, '1.1', 'right version';
is $res->dom->at('p')->text, 'foo', 'right value';
is $res->dom->at('p > a')->text, 'bar', 'right value';
is $res->dom('p')->first->text, 'foo', 'right value';
is_deeply [$res->dom('p > a')->pluck('text')->each], [qw(bar baz)],
'right values';
my @text = $res->dom('a')->pluck(replace_content => 'yada')
->first->root->find('p > a')->pluck('text')->each;
is_deeply \@text, [qw(yada yada)], 'right values';
is_deeply [$res->dom('p > a')->pluck('text')->each], [qw(bar baz)],
'right values';
@text = $res->dom->find('a')->pluck(replace_content => 'test')
->first->root->find('p > a')->pluck('text')->each;
is_deeply \@text, [qw(test test)], 'right values';
is_deeply [$res->dom->find('p > a')->pluck('text')->each], [qw(bar baz)],
'right values';

# Build DOM from response with charset
$res = Mojo::Message::Response->new;
Expand Down

0 comments on commit 5e85909

Please sign in to comment.