-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructered the test for scenarios and implemented the command
all
.
- Loading branch information
Showing
8 changed files
with
118 additions
and
37 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
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
//! # Misc | ||
//! | ||
//! These are miscellaneous integration tests for the application's command-line | ||
//! interface (CLI). | ||
//! | ||
//! `trycmd::TestCases::new()` creates a new set of test cases. Each `.case()` | ||
//! method appends a new test case. The paths in the arguments represent test | ||
//! files which contain the definition of each test case. The library `trycmd` | ||
//! reads these `.md` files and evaluates the results for their correctness. | ||
//! | ||
#[test] | ||
fn use_case_help() { | ||
trycmd::TestCases::new() | ||
.env("PILUM_MODE", "test") | ||
.case("tests/misc/*.md"); | ||
} |
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
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 |
---|---|---|
@@ -1,20 +1,19 @@ | ||
//! # CLI Tests | ||
//! # Scenarios | ||
//! | ||
//! This is a test operation for the application's command-line interface (CLI). | ||
//! These are test scenarios for the application's command-line interface (CLI). | ||
//! | ||
//! `trycmd::TestCases::new()` creates a new set of test cases. Each `.case()` | ||
//! method appends a new test case. The paths in the arguments represent test | ||
//! files which contain the definition of each test case. The library `trycmd` | ||
//! reads these `.md` files and the CLI tests will appraise different sets of | ||
//! commands based on these definitions. | ||
//! reads these `.md` files and evaluates the results for their correctness. | ||
//! | ||
use pilum::database::Database; | ||
|
||
#[tokio::test] | ||
async fn commands() { | ||
#[test] | ||
fn scenarios() { | ||
Database::cleanup_test().expect("Testing cleanup failed."); | ||
|
||
trycmd::TestCases::new() | ||
.env("PILUM_MODE", "test") | ||
.case("tests/commands/*.md"); | ||
.case("tests/scenarios/cake.md"); | ||
} |
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,49 @@ | ||
# Use Case: Cake | ||
|
||
`pilum all` has no tasks to show initially: | ||
|
||
```console | ||
$ pilum all | ||
No tasks found. | ||
|
||
``` | ||
|
||
`pilum add "Buy milk"` adds a new pending task to the task list: | ||
|
||
```console | ||
$ pilum add "Buy flour" | ||
Created task 1: Buy flour | ||
|
||
``` | ||
|
||
`pilum add "Buy eggs"` after `pilum add "Buy milk` adds a second pending task to the task list: | ||
|
||
```console | ||
$ pilum add "Buy milk" | ||
Created task 2: Buy milk | ||
|
||
$ pilum add "Buy eggs" | ||
Created task 3: Buy eggs | ||
|
||
``` | ||
|
||
`pilum add "Buy sugar" "Bake cake"` adds two pending tasks to the task list: | ||
|
||
```console | ||
$ pilum add "Buy sugar" "Bake cake" | ||
Created task 4: Buy sugar | ||
Created task 5: Bake cake | ||
|
||
``` | ||
|
||
`pilum all` shows all tasks. | ||
|
||
```console | ||
$ pilum all | ||
1: Buy flour | ||
2: Buy milk | ||
3: Buy eggs | ||
4: Buy sugar | ||
5: Bake cake | ||
|
||
``` |