Fix tests for Windows.

This commit is contained in:
Sergio Benitez 2019-07-03 21:23:57 -07:00
parent b5b4c696f8
commit 7f2c9f426c
5 changed files with 2 additions and 4 deletions

View File

@ -44,7 +44,7 @@ mod static_tests {
];
fn assert_file(client: &Client, prefix: &str, path: &str, exists: bool) {
let full_path = format!("/{}", Path::new(prefix).join(path).display());
let full_path = format!("/{}/{}", prefix, path);
let mut response = client.get(full_path).dispatch();
if exists {
assert_eq!(response.status(), Status::Ok);

View File

@ -109,7 +109,7 @@ pub trait Normalize {
impl<T: AsRef<Path>> Normalize for T {
#[cfg(windows)]
fn normalized_str(&self) -> Cow<str> {
fn normalized_str(&self) -> Cow<'_, str> {
self.as_ref().to_string_lossy().replace('\\', "/").into()
}

View File

@ -331,8 +331,6 @@ impl Config {
///
/// # #[cfg(not(windows))]
/// assert_eq!(config.root().unwrap(), Path::new("/var/my_app"));
/// # #[cfg(windows)]
/// assert_eq!(config.root().unwrap(), Path::new("C:\\var\\my_app"));
/// ```
pub fn set_root<P: AsRef<Path>>(&mut self, path: P) {
self.root_path = Some(path.as_ref().into());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB