Test::Mojo::Trim - Trim strings for Test::Mojo
Version 0.1000, released 2016-07-22.
use Mojo::Base -strict;
use Mojolicious::Lite;
use Test::More;
use Test::Mojo::Trim;
my $test = Test::Mojo::Trim->new;
get '/test_1';
my $compared_to = qq{ <div><h1>Header</h1><p>A paragraph.</p></div> };
$test->get_ok('/test_1')->status_is(200)->trimmed_content_is($compared_to);
done_testing();
__DATA__
@@ the_test.html.ep
<div>
<h1>Header</h1>
<p>A paragraph.</p>
</div>
Test::Mojo::Trim is an extension to Test::Mojo, that adds an additional string comparison function.
Test::Mojo::Trim inherits all methods from Test::Mojo and implements the following new one.
$test->get_ok('/test')->trimmed_content_is('<html></html>');
Removes all whitespace between tags from the two strings that are compared. That is, if a > and < is separated only by whitespace, that whitespace is removed. Any leading or trailing whitespace is also removed.
https://github.com/Csson/p5-test-mojo-trim
https://metacpan.org/release/Test-Mojo-Trim
Erik Carlsson info@code301.com
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.