-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I already had tests that should have a bigger coverage than reported. Apparently there is an [issue with assert_cmd](assert-rs/assert_cmd#9) that makes it not show coverage correctly for tarpaulin. So the workaround is to test as needed with assert_cmd and in the same function call one that re-runs the command executing run_app and only checks that the result is ok.
- Loading branch information
Showing
2 changed files
with
39 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
use dinero::run_app; | ||
|
||
pub fn test_args(args: &[&str]) { | ||
let mut function_args: Vec<&str> = vec!["testing"]; | ||
for arg in args { | ||
function_args.push(arg); | ||
} | ||
let res = run_app(function_args.iter().map(|x| x.to_string()).collect()); | ||
assert!(res.is_ok()); | ||
} |
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