04 Mar 2022 23:11:08 UTC
- Distribution: Test2-Suite
- Module version: 0.000145
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (54)
- Testers (2196 / 49 / 0)
- KwaliteeBus factor: 7
- 88.51% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity24 month
- Download (224.54KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- CONSTRUCTION OPTIONS
- INSTANCE METHODS
- CLASS METHODS
- OTHER NOTES
Test2::Todo - TODO extension for Test2.
This is an object that lets you create and manage TODO states for tests. This is an extension, 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
todofunction provided by Test2::Tools::Basic.
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");
- 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.
- $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.
When an instance is created a filter sub is added to the Test2::Hub. This filter will set the
diag_todoattributes 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
todoon events in child hubs.
$todoobject falls out of scope and gets garbage collected, the todo will end.
Yes. The most recently created one that is still active will win.
The source code repository for Test2-Suite can be found at https://github.com/Test-More/Test2-Suite/.
Copyright 2018 Chad Granum <firstname.lastname@example.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.