// Given the dependency file contains nested dependencies that contain nested
//     dependencies
// When the command is run with `--recursive`
// Then the nested dependencies are pulled to the correct locations with the
//     correct contents
Given the dependency file contains nested dependencies that contain nested
dependencies
When the command is run with `--recursive`
Then the nested dependencies are pulled to the correct locations with the
correct contents
Given the dependency file contains nested dependencies that contain nested dependencies When the command is run with ` -- recursive ` Then the nested dependencies are pulled to the correct locations with the correct contents
fn double_nested_deps_pulled_correctly() {
    let mut test_deps = success::test_deps();
    let nested_deps_file_conts = indoc!{"
        deps
        all_scripts git git://localhost/all_scripts.git master
    "};
    test_deps.insert(
        "nested_scripts",
        vec![hashmap!{
            "dpnd.txt" => nested_deps_file_conts,
            "script.sh" => "echo 'hello!'",
        }],
    );
    let Layout{dep_srcs_dir, proj_dir, ..} = test_setup::create(
        "double_nested_deps_pulled_correctly",
        &test_deps,
        &hashmap!{},
    );
    let deps_file_conts = indoc!{"
        deps
        nested_scripts git git://localhost/nested_scripts.git master
    "};
    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.arg("--recursive");
            cmd.assert()
        },
    );
    cmd_result.code(0).stdout("").stderr("");
    fs_check::assert_contents(
        &proj_dir,
        &Node::Dir(hashmap!{
            "dpnd.txt" => Node::File(deps_file_conts),
            "deps" => Node::Dir(hashmap!{
                "current_dpnd.txt" => Node::AnyFile,
                "nested_scripts" => Node::Dir(hashmap!{
                    ".git" => Node::AnyDir,
                    "dpnd.txt" => Node::File(nested_deps_file_conts),
                    "script.sh" => Node::File("echo 'hello!'"),
                    "deps" => Node::Dir(hashmap!{
                        "current_dpnd.txt" => Node::AnyFile,
                        "all_scripts" => Node::Dir(hashmap!{
                            ".git" => Node::AnyDir,
                            "dpnd.txt" => Node::AnyFile,
                            "script.sh" => Node::File("echo 'hello, all!'"),
                            "deps" => Node::Dir(hashmap!{
                                "current_dpnd.txt" => Node::AnyFile,
                                "my_scripts" => Node::Dir(hashmap!{
                                    ".git" => Node::AnyDir,
                                    "script.sh" =>
                                        Node::File("echo 'hello, world!'"),
                                }),
                                "your_scripts" => Node::Dir(hashmap!{
                                    ".git" => Node::AnyDir,
                                    "script.sh" =>
                                        Node::File("echo 'hello, sun!'"),
                                }),
                            }),
                        }),
                    }),
                }),
            }),
        }),
    );
}
fn double_nested_deps_pulled_correctly ( ) { let mut test_deps = success :: test_deps ( ) ; let nested_deps_file_conts = indoc ! { " " } ; test_deps . insert ( " " , vec ! [ hashmap { " " nested_deps_file_conts " " " " } ] , ) ; let Layout { dep_srcs_dir , proj_dir , .. } = test_setup :: create ( " " , & test_deps , & hashmap ! { } , ) ; let deps_file_conts = indoc ! { " " } ; 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 . arg ( " " ) ; 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 AnyFile " " Node Dir ( hashmap { " " Node AnyDir " " Node File ( nested_deps_file_conts ) " " Node File ( " " ) " " Node Dir ( hashmap { " " Node AnyFile " " Node Dir ( hashmap { " " Node AnyDir " " Node AnyFile " " Node File ( " " ) " " Node Dir ( hashmap { " " Node AnyFile " " Node Dir ( hashmap { " " Node AnyDir " " Node File ( " " ) } ) " " Node Dir ( hashmap { " " Node AnyDir " " Node File ( " " ) } ) } ) } ) } ) } ) } ) } ) , ) ; }
Given the dependency file contains nested dependencies that contain nested
dependencies
When the command is run with `--recursive`
Then the nested dependencies are pulled to the correct locations with the
correct contents
Given the dependency file contains nested dependencies that contain nested dependencies When the command is run with ` -- recursive ` Then the nested dependencies are pulled to the correct locations with the correct contents