aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fixtures/mod.rs
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2025-02-06 03:30:28 +0000
committerSven-Hendrik Haase <svenstaro@gmail.com>2025-02-06 03:30:28 +0000
commitf0eb61436e62d0d0d755ac8280bf97b4b52d4e0b (patch)
treeb6a27e61b6a0084b4944613c61d7392ccca55bbb /tests/fixtures/mod.rs
parentMake clippy happy (diff)
downloadminiserve-f0eb61436e62d0d0d755ac8280bf97b4b52d4e0b.tar.gz
miniserve-f0eb61436e62d0d0d755ac8280bf97b4b52d4e0b.zip
Get rid of server_no_stderr
We'll now always just pipe the contents of the child to the parent.
Diffstat (limited to 'tests/fixtures/mod.rs')
-rw-r--r--tests/fixtures/mod.rs30
1 files changed, 2 insertions, 28 deletions
diff --git a/tests/fixtures/mod.rs b/tests/fixtures/mod.rs
index a96a5b7..f95d4f6 100644
--- a/tests/fixtures/mod.rs
+++ b/tests/fixtures/mod.rs
@@ -121,34 +121,8 @@ where
.arg("-p")
.arg(port.to_string())
.args(args.clone())
- .stdout(Stdio::null())
- .spawn()
- .expect("Couldn't run test binary");
- let is_tls = args
- .into_iter()
- .any(|x| x.as_ref().to_str().unwrap().contains("tls"));
-
- wait_for_port(port);
- TestServer::new(port, tmpdir, child, is_tls)
-}
-
-/// Same as `server()` but ignore stderr
-#[fixture]
-pub fn server_no_stderr<I>(#[default(&[] as &[&str])] args: I) -> TestServer
-where
- I: IntoIterator + Clone,
- I::Item: AsRef<std::ffi::OsStr>,
-{
- let port = port();
- let tmpdir = tmpdir();
- let child = Command::cargo_bin("miniserve")
- .expect("Couldn't find test binary")
- .arg(tmpdir.path())
- .arg("-p")
- .arg(port.to_string())
- .args(args.clone())
- .stdout(Stdio::null())
- .stderr(Stdio::null())
+ .stdout(Stdio::piped())
+ .stderr(Stdio::piped())
.spawn()
.expect("Couldn't run test binary");
let is_tls = args