fn output_dir_is_subdir() {
    let test_deps = test_deps();
    let Layout{dep_srcs_dir, proj_dir, deps_commit_hashes, ..} =
        test_setup::create("output_dir_is_subdir", &test_deps, &hashmap!{});
    let deps_file_conts = formatdoc!{
        "
            # This is the output directory.
            target/deps

            # These are the dependencies.
            my_scripts git git://localhost/my_scripts.git {}
        ",
        deps_commit_hashes["my_scripts"][0],
    };
    let deps_file = format!("{}/dpnd.txt", proj_dir);
    fs::write(&deps_file, &deps_file_conts)
        .expect("couldn't write dependency file");
    let cmd_result = test_setup::with_git_server(
        dep_srcs_dir,
        || {
            let mut cmd = test_setup::new_test_cmd(proj_dir.clone());

            cmd.assert()
        },
    );

    cmd_result.code(0).stdout("").stderr("");
    fs_check::assert_contents(
        &proj_dir,
        &Node::Dir(hashmap!{
            "dpnd.txt" => Node::File(&deps_file_conts),
            "target" => Node::Dir(hashmap!{
                "deps" => Node::Dir(hashmap!{
                    "current_dpnd.txt" => Node::AnyFile,
                    "my_scripts" => Node::Dir(hashmap!{
                        ".git" => Node::AnyDir,
                        "script.sh" => Node::File("echo 'hello world'"),
                    }),
                }),
            }),
        }),
    );
}
// Given the output directory is a subdirectory of another directory
// When the command is run
// Then dependencies are pulled to the correct locations
Given the output directory is a subdirectory of another directory
When the command is run
Then dependencies are pulled to the correct locations
Given the output directory is a subdirectory of another directory When the command is run Then dependencies are pulled to the correct locations
fn output_dir_is_subdir() {
    let test_deps = test_deps();
    let Layout{dep_srcs_dir, proj_dir, deps_commit_hashes, ..} =
        test_setup::create("output_dir_is_subdir", &test_deps, &hashmap!{});
    let deps_file_conts = formatdoc!{
        "
            # This is the output directory.
            target/deps
            # These are the dependencies.
            my_scripts git git://localhost/my_scripts.git {}
        ",
        deps_commit_hashes["my_scripts"][0],
    };
    let deps_file = format!("{}/dpnd.txt", proj_dir);
    fs::write(&deps_file, &deps_file_conts)
        .expect("couldn't write dependency file");
    let cmd_result = test_setup::with_git_server(
        dep_srcs_dir,
        || {
            let mut cmd = test_setup::new_test_cmd(proj_dir.clone());
            cmd.assert()
        },
    );
    cmd_result.code(0).stdout("").stderr("");
    fs_check::assert_contents(
        &proj_dir,
        &Node::Dir(hashmap!{
            "dpnd.txt" => Node::File(&deps_file_conts),
            "target" => Node::Dir(hashmap!{
                "deps" => Node::Dir(hashmap!{
                    "current_dpnd.txt" => Node::AnyFile,
                    "my_scripts" => Node::Dir(hashmap!{
                        ".git" => Node::AnyDir,
                        "script.sh" => Node::File("echo 'hello world'"),
                    }),
                }),
            }),
        }),
    );
}
fn output_dir_is_subdir ( ) { let test_deps = test_deps ( ) ; let Layout { dep_srcs_dir , proj_dir , deps_commit_hashes , .. } = test_setup :: create ( " " , & test_deps , & hashmap ! { } ) ; let deps_file_conts = formatdoc ! { " " deps_commit_hashes [ " " ] [ 0 ] } ; let deps_file = format ! ( " " proj_dir ) ; fs :: write ( & deps_file , & deps_file_conts ) . expect ( " " ) ; let cmd_result = test_setup :: with_git_server ( dep_srcs_dir , | | { let mut cmd = test_setup :: new_test_cmd ( proj_dir . clone ( ) ) ; cmd . assert ( ) } , ) ; cmd_result . code ( 0 ) . stdout ( " " ) . stderr ( " " ) ; fs_check :: assert_contents ( & proj_dir , & Node :: Dir ( hashmap ! { " " Node File ( deps_file_conts ) " " Node Dir ( hashmap { " " Node Dir ( hashmap { " " Node AnyFile " " Node Dir ( hashmap { " " Node AnyDir " " Node File ( " " ) } ) } ) } ) } ) , ) ; }
Given the output directory is a subdirectory of another directory
When the command is run
Then dependencies are pulled to the correct locations
Given the output directory is a subdirectory of another directory When the command is run Then dependencies are pulled to the correct locations