Skip to content

Commit

Permalink
Use which instead of tar as reference tldr page in tests (dbrgn#192)
Browse files Browse the repository at this point in the history
The page for `tar` changes pretty frequently. `which` was last updated in 2018 and is a rather simple command overall. So it is less likely that the reference in the repository has to be updated as often as the one for `tar`.
  • Loading branch information
SimplyDanny committed May 13, 2021
1 parent 25f7365 commit b634263
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 43 deletions.
12 changes: 6 additions & 6 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,12 @@ fn test_os_specific_page() {
fn test_markdown_rendering() {
let testenv = TestEnv::new();

testenv.add_entry("tar", include_str!("tar-markdown.expected"));
testenv.add_entry("which", include_str!("which-markdown.expected"));

let expected = include_str!("tar-markdown.expected");
let expected = include_str!("which-markdown.expected");
testenv
.command()
.args(&["-m", "tar"])
.args(&["-m", "which"])
.assert()
.success()
.stdout(similar(expected));
Expand Down Expand Up @@ -427,7 +427,7 @@ fn test_pager_flag_enable() {

testenv
.command()
.args(&["--pager", "tar"])
.args(&["--pager", "which"])
.assert()
.success();
}
Expand Down Expand Up @@ -618,15 +618,15 @@ fn test_pager_warning() {
// Regular call should not show a "pager flag not available on windows" warning
testenv
.command()
.args(&["tar"])
.args(&["which"])
.assert()
.success()
.stderr(contains("pager flag not available on Windows").not());

// But it should be shown if the pager flag is true
testenv
.command()
.args(&["tar", "-p"])
.args(&["which", "-p"])
.assert()
.success()
.stderr(contains("pager flag not available on Windows"));
Expand Down
37 changes: 0 additions & 37 deletions tests/tar-markdown.expected

This file was deleted.

11 changes: 11 additions & 0 deletions tests/which-markdown.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# which

> Locate a program in the user's path.

- Search the PATH environment variable and display the location of any matching executables:

`which {{executable}}`

- If there are multiple executables which match, display all:

`which -a {{executable}}`

0 comments on commit b634263

Please sign in to comment.