Code Monkey home page Code Monkey logo

p5-test-mojo-trim's Introduction

NAME

Test::Mojo::Trim - Trim strings for Test::Mojo

Requires Perl 5.10+ Travis status Distribution kwalitee CPAN Testers result coverage 68.4%

VERSION

Version 0.1000, released 2016-07-22.

SYNOPSIS

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>

DESCRIPTION

Test::Mojo::Trim is an extension to Test::Mojo, that adds an additional string comparison function.

METHODS

Test::Mojo::Trim inherits all methods from Test::Mojo and implements the following new one.

trimmed_content_is

$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.

SEE ALSO

SOURCE

https://github.com/Csson/p5-test-mojo-trim

HOMEPAGE

https://metacpan.org/release/Test-Mojo-Trim

AUTHOR

Erik Carlsson [email protected]

COPYRIGHT AND LICENSE

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.

p5-test-mojo-trim's People

Contributors

csson avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.