GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST2::TODO (3)

.ds Aq ’

NAME

Test2::Todo - TODO extention for Test2.

CONTENTS

DESCRIPTION

This is an object that lets you create and manage TODO states for tests. This is an extention, not a plugin or a tool. This library can be used by plugins and tools to manage todo states.

If you simply want to write a todo test then you should look at the todo function provided by Test2::Tools::Basic.

SYNOPSYS



    use Test2::Todo;

    # Start the todo
    my $todo = Test2::Todo->new(reason => Fix later);

    # Will be considered todo, so suite still passes
    ok(0, "oops");

    # End the todo
    $todo->end;

    # TODO has ended, this test will actually fail.
    ok(0, "oops");



CONSTRUCTION OPTIONS

reason (required) The reason for the todo, this can be any defined value.
hub (optional) The hub to which the TODO state should be applied. If none is provided then the current global hub is used.

INSTANCE METHODS

$todo->end End the todo state.

CLASS METHODS

$count = Test2::Todo->hub_in_todo($hub) If the hub has any todo objects this will return the total number of them. If the hub has no todo objects it will return 0.

OTHER NOTES

    How it works

When an instance is created a filter sub is added to the Test2::Hub. This filter will set the todo and diag_todo attributes on all events as they come in. When the instance is destroyed, or end() is called, the filter is removed.

When a new hub is pushed (such as when a subtest is started) the new hub will inherit the filter, but it will only set diag_todo, it will not set todo on events in child hubs.

CW$todo->end is called at destruction

If your $todo object falls out of scope and gets garbage collected, the todo will end.

    Can I use multiple instances?

Yes. Most recently created one that is still active will win.

SOURCE

The source code repository for Test2-Suite can be found at http://github.com/Test-More/Test2-Suite/.

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright 2015 Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST2::TODO (3) 2016-03-20

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.