aboutsummaryrefslogtreecommitdiffstats
path: root/tests/serve_request.rs
diff options
context:
space:
mode:
authorAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2021-04-18 03:47:23 +0000
committerGitHub <noreply@github.com>2021-04-18 03:47:23 +0000
commitc368a113957d42666f080303783174e4adaf02b4 (patch)
tree96349d7f01be73cf6f80962bf34a9af543c2971c /tests/serve_request.rs
parentDon't use different syle for symlink symbol (diff)
parentUpdate README for separate .tar and .tar.gz flags (diff)
downloadminiserve-c368a113957d42666f080303783174e4adaf02b4.tar.gz
miniserve-c368a113957d42666f080303783174e4adaf02b4.zip
Merge branch 'master' into rfc-resolve-symlinks
Diffstat (limited to 'tests/serve_request.rs')
-rw-r--r--tests/serve_request.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/serve_request.rs b/tests/serve_request.rs
index 1e92339..e259b9e 100644
--- a/tests/serve_request.rs
+++ b/tests/serve_request.rs
@@ -55,6 +55,12 @@ fn serves_requests_with_non_default_port(tmpdir: TempDir, port: u16) -> Result<(
for &file in FILES {
let f = parsed.find(|x: &Node| x.text() == file).next().unwrap();
+ reqwest::blocking::get(format!(
+ "http://localhost:{}/{}",
+ port,
+ f.attr("href").unwrap()
+ ))?
+ .error_for_status()?;
assert_eq!(
format!("/{}", file),
percent_encoding::percent_decode_str(f.attr("href").unwrap()).decode_utf8_lossy(),
@@ -259,17 +265,18 @@ fn serves_requests_custom_index_notice(tmpdir: TempDir, port: u16) -> Result<(),
.arg(port.to_string())
.arg(tmpdir.path())
.stdout(Stdio::piped())
+ .stderr(Stdio::piped())
.spawn()?;
sleep(Duration::from_secs(1));
child.kill()?;
let output = child.wait_with_output().expect("Failed to read stdout");
- let all_text = String::from_utf8(output.stdout);
+ let all_text = String::from_utf8(output.stderr);
assert!(all_text
.unwrap()
- .contains("The provided index file could not be found"));
+ .contains("The file 'not.html' provided for option --index could not be found."));
Ok(())
}