Testing code can involve making sure that files are created and deleted as expected. Doing this manually can be error prone, as it's easy to forget a file, or miss that some unexpected file was added. This module simplifies maintaining test directories by tracking their status as they are modified or tested with this API, making it simple to test both individual files, as well as to verify that there are no missing or unknown files.
The idea is to use this API to create a temporary directory and populate an initial set of files. Then, whenever something in the directory is changes, use the test methods to verify that the change happened as expected. At any time, it is simple to verify that the contents of the directory are exactly as expected.
Test::Directory implements an object-oriented interface for managing test directories. It tracks which files it knows about (by creating or testing them via its API), and can report if any files were missing or unexpectedly added.
There are two flavors of methods for interacting with the directory. Utility methods simply return a value (i.e. the number of files/errors) with no output, while the Test functions use Test::Builder to produce the approriate test results and diagnostics for the test harness.
The directory will be automatically cleaned up when the object goes out of scope; see the clean method below for details.
Package Version | Update ID | Released | Package Hub Version | Platforms | Subpackages |
---|---|---|---|---|---|
0.052-bp156.1.1 info | GA Release | 2023-09-01 | 15 SP6 |
|
|
0.051-bp155.2.10 info | GA Release | 2023-05-17 | 15 SP5 |
|
|
0.051-bp154.1.21 info | GA Release | 2022-05-09 | 15 SP4 |
|
|
0.041-bp153.1.15 info | GA Release | 2021-03-06 | 15 SP3 |
|
|
0.041-bp152.3.15 info | GA Release | 2020-04-16 | 15 SP2 |
|
|
0.041-bp151.1.1 info | GA Release | 2019-06-18 | 15 SP1 |
|
|