-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(generate): test default and provided name
- Loading branch information
1 parent
f3471a7
commit a6bbcfd
Showing
2 changed files
with
31 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use assert_cmd::prelude::*; | ||
use std::str; | ||
use utils; | ||
|
||
#[test] | ||
fn generate_with_defaults() { | ||
let fixture = utils::fixture::not_a_crate(); | ||
let cmd = fixture.wasm_pack().arg("generate").assert().failure(); | ||
|
||
let output = cmd.get_output(); | ||
|
||
assert!(str::from_utf8(&output.stdout) | ||
.unwrap() | ||
.contains("hello-wasm")); | ||
} | ||
|
||
#[test] | ||
fn generate_with_provided_name() { | ||
let fixture = utils::fixture::not_a_crate(); | ||
let cmd = fixture | ||
.wasm_pack() | ||
.arg("generate") | ||
.arg("--name ferris") | ||
.assert() | ||
.failure(); | ||
|
||
let output = cmd.get_output(); | ||
|
||
assert!(str::from_utf8(&output.stdout).unwrap().contains("ferris")); | ||
} |
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