Move examples into tests/fixtures

These aren't examples in the sense Cargo uses them; they're test
fixtures. As such, let's put them in tests/

Fixes #56
master
steveklabnik 7 years ago
parent 030472bfa2
commit 033aaaa19b
  1. 0
      tests/fixtures/js-hello-world/Cargo.lock
  2. 0
      tests/fixtures/js-hello-world/Cargo.toml
  3. 0
      tests/fixtures/js-hello-world/README.md
  4. 0
      tests/fixtures/js-hello-world/src/lib.rs
  5. 0
      tests/fixtures/no-readme/Cargo.lock
  6. 0
      tests/fixtures/no-readme/Cargo.toml
  7. 0
      tests/fixtures/no-readme/src/lib.rs
  8. 6
      tests/manifest.rs
  9. 2
      tests/readme.rs

@ -18,9 +18,9 @@ fn it_gets_the_crate_name_default_path() {
#[test] #[test]
fn it_gets_the_crate_name_provided_path() { fn it_gets_the_crate_name_provided_path() {
assert!(manifest::get_crate_name("./examples/js-hello-world").is_ok()); assert!(manifest::get_crate_name("tests/fixtures/js-hello-world").is_ok());
assert_eq!( assert_eq!(
manifest::get_crate_name("./examples/js-hello-world").unwrap(), manifest::get_crate_name("tests/fixtures/js-hello-world").unwrap(),
"js-hello-world" "js-hello-world"
); );
} }
@ -45,7 +45,7 @@ fn it_creates_a_package_json_default_path() {
#[test] #[test]
fn it_creates_a_package_json_provided_path() { fn it_creates_a_package_json_provided_path() {
let path = "./examples/js-hello-world".to_string(); let path = "tests/fixtures/js-hello-world".to_string();
wasm_pack::create_pkg_dir(&path).unwrap(); wasm_pack::create_pkg_dir(&path).unwrap();
assert!(manifest::write_package_json(&path).is_ok()); assert!(manifest::write_package_json(&path).is_ok());
let package_json_path = format!("{}/pkg/package.json", &path); let package_json_path = format!("{}/pkg/package.json", &path);

@ -21,7 +21,7 @@ fn it_copies_a_readme_default_path() {
#[test] #[test]
fn it_creates_a_package_json_provided_path() { fn it_creates_a_package_json_provided_path() {
let path = "./examples/js-hello-world".to_string(); let path = "tests/fixtures/js-hello-world".to_string();
assert!(readme::copy_from_crate(&path).is_ok()); assert!(readme::copy_from_crate(&path).is_ok());
let crate_readme_path = format!("{}/README.md", &path); let crate_readme_path = format!("{}/README.md", &path);
let pkg_readme_path = format!("{}/pkg/README.md", &path); let pkg_readme_path = format!("{}/pkg/README.md", &path);

Loading…
Cancel
Save