Assert::Refute::T::Tester - test the test conditions themselves
This module is inspired by Test::Tester. While contract_is is a good way to quickly determine whether a test condition holds any water, a more detailed inspection is desirable.
contract_is
[EXPERIMENTAL] This module is under active development and its interface may change in the future.
use Test::More; use Assert::Refute::T::Tester; use My::Refute::Module qw(check_this check_that); my $report = try_refute { check_this(...); # pass check_that(...); # fail }; test_test $report->get_result_details(0), { diag => [] }, "No premature output"; test_test $report->get_result_details(1), { ok => 1 }, "Passing test"; test_test $report->get_result_details(2), { ok => 0, diag => [ qr/foo/, qr/bar/ ] }, "Failing test";
The following functions are exported by default:
test_test \%result_details, \%spec, "Message";
Result details come from "get_result_details($id)" in Assert::Refute::Report.
The exact format MAY change in the future, but this test should keep working.
%spec may include:
ok - whether the test passed or not.
ok
name - test name (without the number) Can be exact string or regular expression.
name
diag - an array of exact strings or regular expressions. Each line of output will be matched against exactly one expectation.
diag
Output produced by note() is ignored.
note()
This module is part of Assert::Refute suite.
Copyright 2017-2018 Konstantin S. Uvarin. <khedin at cpan.org>
<khedin at cpan.org>
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
To install Assert::Refute, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Assert::Refute
CPAN shell
perl -MCPAN -e shell install Assert::Refute
For more information on module installation, please visit the detailed CPAN module installation guide.