From e011f91656905e78eb47df8933f5e9c491ea454e Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Fri, 28 Oct 2016 15:34:01 -0700 Subject: [PATCH] Move order test to integration tests --- src/integration.rs | 41 +++++++++++++++++++++++++++++++++++++++++ src/tests.rs | 7 ------- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/integration.rs b/src/integration.rs index 0675383..5694134 100644 --- a/src/integration.rs +++ b/src/integration.rs @@ -61,3 +61,44 @@ fn simple() { "echo hello\n", ) } + +#[test] +fn quiet() { + integration_test( + "quiet", + &[], + "default:\n @echo hello", + 0, + "hello\n", + "", + ) +} + +#[test] +fn order() { + let text = " +b: a + echo b + @mv a b + +a: + echo a + @touch F + @touch a + +d: c + echo d + @rm c + +c: b + echo c + @mv b c"; + integration_test( + "order", + &["a", "d"], + text, + 0, + "a\nb\nc\nd\n", + "echo a\necho b\necho c\necho d\n", + ); +} diff --git a/src/tests.rs b/src/tests.rs index e2637a5..924b446 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -633,8 +633,6 @@ fn unknown_second_interpolation_variable() { #[test] fn run_order() { - let tmp = tempdir::TempDir::new("run_order").unwrap_or_else(|err| panic!("tmpdir: failed to create temporary directory: {}", err)); - let path = tmp.path().to_str().unwrap_or_else(|| panic!("tmpdir: path was not valid UTF-8")).to_owned(); let text = r" b: a @mv a b @@ -649,11 +647,6 @@ d: c c: b @mv b c"; tokenize_success(text, "$N:N$>^_$$^_$^_$$^_$$^_<."); - super::std::env::set_current_dir(path).expect("failed to set current directory"); - parse_success(text).run(&["a", "d"]).unwrap(); - if let Err(_) = super::std::fs::metadata("F") { - panic!("recipes did not run"); - } } #[test]