aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auth.rs2
-rw-r--r--tests/cli.rs2
-rw-r--r--tests/navigation.rs3
-rw-r--r--tests/serve_request.rs8
4 files changed, 9 insertions, 6 deletions
diff --git a/tests/auth.rs b/tests/auth.rs
index 4cabb77..255c09f 100644
--- a/tests/auth.rs
+++ b/tests/auth.rs
@@ -4,8 +4,8 @@ use assert_cmd::prelude::*;
use assert_fs::fixture::TempDir;
use fixtures::{port, tmpdir, Error, FILES};
use pretty_assertions::assert_eq;
-use reqwest::StatusCode;
use reqwest::blocking::Client;
+use reqwest::StatusCode;
use rstest::rstest;
use select::document::Document;
use select::predicate::Text;
diff --git a/tests/cli.rs b/tests/cli.rs
index 5bd7d96..e09473d 100644
--- a/tests/cli.rs
+++ b/tests/cli.rs
@@ -1,9 +1,9 @@
mod fixtures;
use assert_cmd::prelude::*;
-use structopt::clap::{crate_name, crate_version};
use fixtures::Error;
use std::process::Command;
+use structopt::clap::{crate_name, crate_version};
#[test]
/// Show help and exit.
diff --git a/tests/navigation.rs b/tests/navigation.rs
index 224f100..7320f06 100644
--- a/tests/navigation.rs
+++ b/tests/navigation.rs
@@ -52,7 +52,8 @@ fn can_navigate_into_dirs_and_back(tmpdir: TempDir, port: u16) -> Result<(), Err
let initial_parsed = Document::from_read(initial_body)?;
for &directory in DIRECTORIES {
let dir_elem = get_link_from_text(&initial_parsed, &directory).expect("Dir not found.");
- let body = reqwest::blocking::get(&format!("{}{}", base_url, dir_elem))?.error_for_status()?;
+ let body =
+ reqwest::blocking::get(&format!("{}{}", base_url, dir_elem))?.error_for_status()?;
let parsed = Document::from_read(body)?;
let back_link =
get_link_from_text(&parsed, "Parent directory").expect("Back link not found.");
diff --git a/tests/serve_request.rs b/tests/serve_request.rs
index 9c30bb8..5761a65 100644
--- a/tests/serve_request.rs
+++ b/tests/serve_request.rs
@@ -41,7 +41,8 @@ fn serves_requests_with_non_default_port(tmpdir: TempDir, port: u16) -> Result<(
sleep(Duration::from_secs(1));
- let body = reqwest::blocking::get(format!("http://localhost:{}", port).as_str())?.error_for_status()?;
+ let body = reqwest::blocking::get(format!("http://localhost:{}", port).as_str())?
+ .error_for_status()?;
let parsed = Document::from_read(body)?;
for &file in FILES {
assert!(parsed.find(|x: &Node| x.text() == file).next().is_some());
@@ -51,8 +52,9 @@ fn serves_requests_with_non_default_port(tmpdir: TempDir, port: u16) -> Result<(
.find(|x: &Node| x.text() == directory)
.next()
.is_some());
- let dir_body = reqwest::blocking::get(format!("http://localhost:{}/{}", port, directory).as_str())?
- .error_for_status()?;
+ let dir_body =
+ reqwest::blocking::get(format!("http://localhost:{}/{}", port, directory).as_str())?
+ .error_for_status()?;
let dir_body_parsed = Document::from_read(dir_body)?;
for &file in FILES {
assert!(dir_body_parsed