Skip to content

Commit

Permalink
test(generate): test default and provided name
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleygwilliams committed Apr 11, 2019
1 parent f3471a7 commit a6bbcfd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/all/generate.rs
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"));
}
1 change: 1 addition & 0 deletions tests/all/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extern crate wasm_pack;

mod build;
mod download;
mod generate;
mod license;
mod lockfile;
mod manifest;
Expand Down

0 comments on commit a6bbcfd

Please sign in to comment.