Skip to content

Commit 40dfbfb

Browse files
committed
more descriptive test names (GitoxideLabs#331)
1 parent 5fb6c41 commit 40dfbfb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

git-config/src/values.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,13 @@ pub mod path {
382382
}
383383

384384
#[cfg(test)]
385-
mod tests {
385+
mod interpolate_tests {
386386
use std::borrow::Cow;
387387

388388
use crate::values::{path::interpolate::Error, Path};
389389

390390
#[test]
391-
fn not_interpolated() {
391+
fn no_interpolation_for_paths_without_tilde_or_prefix() {
392392
let path = &b"/foo/bar"[..];
393393
let actual = Path::from(Cow::Borrowed(path));
394394
assert_eq!(&*actual, path);
@@ -399,15 +399,15 @@ pub mod path {
399399
}
400400

401401
#[test]
402-
fn empty_is_error() {
402+
fn empty_path_is_error() {
403403
assert!(matches!(
404404
Path::from(Cow::Borrowed("".as_bytes())).interpolate(None),
405405
Err(Error::Missing { what: "path" })
406406
));
407407
}
408408

409409
#[test]
410-
fn prefix_interpolated() {
410+
fn prefix_substitutes_git_install_dir() {
411411
for git_install_dir in &["/tmp/git", "C:\\git"] {
412412
for (val, expected) in &[
413413
(&b"%(prefix)/foo/bar"[..], "foo/bar"),
@@ -431,7 +431,7 @@ pub mod path {
431431
}
432432

433433
#[test]
434-
fn disabled_prefix_interpolation() {
434+
fn prefix_substitution_skipped_with_dot_slash() {
435435
let path = "./%(prefix)/foo/bar";
436436
let git_install_dir = "/tmp/git";
437437
assert_eq!(
@@ -443,7 +443,7 @@ pub mod path {
443443
}
444444

445445
#[test]
446-
fn tilde_interpolated() {
446+
fn tilde_substitutes_current_user() {
447447
let path = &b"~/foo/bar"[..];
448448
let expected = format!(
449449
"{}{}foo/bar",
@@ -459,16 +459,16 @@ pub mod path {
459459

460460
#[cfg(target_os = "windows")]
461461
#[test]
462-
fn user_interpolated() {
462+
fn tilde_with_given_user_is_unsupported_on_windows() {
463463
assert!(matches!(
464464
Path::from(Cow::Borrowed(&b"~baz/foo/bar"[..])).interpolate(None),
465-
Err(path::interpolate::Error::UserInterpolationUnsupported)
465+
Err(Error::UserInterpolationUnsupported)
466466
));
467467
}
468468

469469
#[cfg(not(target_os = "windows"))]
470470
#[test]
471-
fn user_interpolated() {
471+
fn tilde_with_given_user() {
472472
let user = std::env::var("USER").unwrap();
473473
let home = std::env::var("HOME").unwrap();
474474
let specific_user_home = format!("~{}", user);

0 commit comments

Comments
 (0)