Specker
Checks if any number of files match some specification. Designed for testing file generation.
Let's say we have this specification:
## file: output/index.html
..
<body>
..
## file: output/style.css
..
body {
..
}
..
Specker can check if there is a file named output/index.html containing
<body> in some line, as well as file output/style.css
containing body { and } lines. Symbol .. matches any number of
lines.
If there is a match error, specker can print a nice message like:
1 | <bddy>
| ^^^^^^
| Expected "<body>", found "<bddy>"
It also has iterators to run many such specification tests in bulk.
Example code that iterates the "spec" dir, collects all "txt" specifications and checks them:
extern crate specker;
use fs;
use env;
use PathBuf;
use HashMap;
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.