Hi.

Since couple commits ago application tests with Test::Mojo got little bit 
more complex.

<h1>
    Mojolicious
</h1>


$ua->get_ok(...)->text_is('h1', 'Mojolicious');

#          got: '
#     Mojolicious
# '
#     expected: 'Mojolicious'

Isn't it a good idea to provide a test method which performs trim and 
compare at once?
It also makes upgrading to v7.0 easier.

$ua->get_ok(...)->text_resemble('h1', 'Mojolicious');

package Test::Mojo

sub text_resemble {
  my ($self, $selector, $value, $desc) = @_;
  $desc ||= encode 'UTF-8', qq{exact match for selector "$selector"};
  return $self->_test('is', trim($self->_text($selector)), $value, $desc);
}

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to