-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #307 from epage/mv
refactor: Move trycmd into a folder
- Loading branch information
Showing
73 changed files
with
126 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
crates/snapbox/README.md |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
[package] | ||
name = "trycmd" | ||
version = "0.15.2" | ||
description = "Snapshot testing for a herd of CLI tests" | ||
authors = ["Ed Page <eopage@gmail.com>"] | ||
repository = "https://github.com/assert-rs/trycmd.git" | ||
homepage = "https://github.com/assert-rs/trycmd" | ||
documentation = "http://docs.rs/trycmd/" | ||
readme = "README.md" | ||
categories = ["development-tools::testing"] | ||
keywords = ["cli", "test", "assert", "command", "duct"] | ||
license.workspace = true | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
include.workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] | ||
|
||
[package.metadata.release] | ||
pre-release-replacements = [ | ||
{file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, | ||
{file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1}, | ||
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, | ||
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1}, | ||
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/assert-rs/trycmd/compare/{{tag_name}}...HEAD", exactly=1}, | ||
] | ||
|
||
[features] | ||
default = ["color-auto", "filesystem", "diff"] | ||
color = ["snapbox/color", "dep:anstream"] | ||
color-auto = ["snapbox/color-auto"] | ||
diff = ["snapbox/diff"] | ||
filesystem = ["snapbox/path"] | ||
|
||
schema = ["dep:schemars", "dep:serde_json"] | ||
examples = ["snapbox/examples"] | ||
debug = ["snapbox/debug"] | ||
|
||
[[bin]] | ||
name = "bin-fixture" | ||
|
||
[[bin]] | ||
name = "trycmd-schema" | ||
required-features = ["schema"] | ||
|
||
[dependencies] | ||
automod = "1.0.14" | ||
snapbox = { path = "../snapbox", version = "0.5.10", default-features = false, features = ["cmd"] } | ||
anstream = { version = "0.6.7", optional = true } | ||
|
||
glob = "0.3.0" | ||
rayon = "1.5.1" | ||
|
||
serde = { version = "1.0", features = ["derive"] } | ||
shlex = "1.1.0" | ||
humantime = "2" | ||
humantime-serde = "1" | ||
toml_edit = { version = "0.19.14", features = ["serde"] } | ||
escargot = { version = "0.5.7", optional = true } | ||
|
||
schemars = { version = "0.8.3", features = ["preserve_order"], optional = true } | ||
serde_json = { version = "1.0", optional = true } | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../LICENSE-APACHE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../LICENSE-MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# trycmd | ||
|
||
> Treat your tests like cattle, instead of [pets](https://docs.rs/snapbox) | ||
[][Documentation] | ||
 | ||
[][Crates.io] | ||
|
||
`trycmd` is a test harness that will enumerate test case files and run them to verify the | ||
results, taking inspiration from | ||
[trybuild](https://crates.io/crates/trybuild) and [cram](https://bitheap.org/cram/). | ||
|
||
## Example | ||
|
||
To create a minimal setup, create a `tests/cli_tests.rs` with | ||
```rust,no_run | ||
#[test] | ||
fn cli_tests() { | ||
trycmd::TestCases::new() | ||
.case("tests/cmd/*.toml") | ||
.case("README.md"); | ||
} | ||
``` | ||
and write out your test cases in `.toml` files along with examples in your `README.md`. | ||
|
||
Run this with `cargo test` like normal. `TestCases` will enumerate all test case files and | ||
run the contained commands, verifying they run as expected. | ||
|
||
See the [docs](http://docs.rs/trycmd) for more. | ||
|
||
## Users | ||
|
||
- [typos](https://github.com/crate-ci/typos) (source code spell checker) | ||
- See [port from `assert_cmd`](https://github.com/crate-ci/typos/compare/a8ae8a5..cdfdc4084c928423211c6a80acbd24dbed7108f6) | ||
- [cargo-edit](https://github.com/killercup/cargo-edit) (`Cargo.toml` editor) | ||
- [clap](https://github.com/clap-rs/clap/) (CLI parser) to test examples | ||
|
||
## License | ||
|
||
Licensed under either of | ||
|
||
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>) | ||
* MIT license ([LICENSE-MIT](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. | ||
|
||
[Crates.io]: https://crates.io/crates/trycmd | ||
[Documentation]: https://docs.rs/trycmd |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.