Skip to content

Commit

Permalink
fixed small bug in Test::Mojo
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 5, 2012
1 parent 7566cfd commit 060c1a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,9 +1,10 @@

3.03 2012-07-05
3.03 2012-07-06
- Improved Hypnotoad log messages.
- Improved documentation.
- Improved tests.
- Fixed small namespace detection bug in Mojo::DOM.
- Fixed small bug in Test::Mojo.

3.02 2012-07-03
- Added pluck and uniq methods to Mojo::Collection.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Template.pm
Expand Up @@ -311,7 +311,7 @@ sub _trim {
for (my $j = @$line - 4; $j >= 0; $j -= 2) {

# Skip capture
next if $line->[$j] eq 'cpst' || $line->[$j] eq 'cpen';
next if $line->[$j] ~~ [qw(cpst cpen)];

# Only trim text
return unless $line->[$j] eq 'text';
Expand Down
5 changes: 2 additions & 3 deletions lib/Test/Mojo.pm
Expand Up @@ -246,9 +246,8 @@ sub put_ok { shift->_request_ok(put => @_) }

sub reset_session {
my $self = shift;
$self->ua->cookie_jar->empty;
$self->tx(undef);
return $self;
if (my $jar = $self->ua->cookie_jar) { $jar->empty }
return $self->tx(undef);
}

sub send_ok {
Expand Down
3 changes: 1 addition & 2 deletions t/mojolicious/group_lite_app.t
Expand Up @@ -265,10 +265,9 @@ $t->get_ok('/bridge2stash' => {'X-Flash' => 1})->status_is(200)
# GET /bridge2stash (again without cookie jar)
$t->get_ok('/bridge2stash' => {'X-Flash' => 1})->status_is(200)
->content_is("stash too!!!!!!!\n");
$t->ua->cookie_jar(Mojo::UserAgent::CookieJar->new);
$t->reset_session->ua->cookie_jar(Mojo::UserAgent::CookieJar->new);

# GET /bridge2stash (fresh start)
$t->reset_session;
$t->get_ok('/bridge2stash' => {'X-Flash' => 1})->status_is(200)
->content_is("stash too!!!!!!!\n");

Expand Down

0 comments on commit 060c1a4

Please sign in to comment.