Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions tests/cli_alias_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ fn test_silent_flag_suppresses_cli_warnings() {
fn test_inline_config_unknown_rule_warning() {
let temp_dir = tempdir().expect("Failed to create temp dir");
let test_file = temp_dir.path().join("test.md");
let rumdl_exe = env!("CARGO_BIN_EXE_rumdl");

// Create a file with an inline config comment using an unknown rule
fs::write(
Expand All @@ -483,7 +484,7 @@ Some content
)
.expect("Failed to write test file");

let output = Command::new("./target/debug/rumdl")
let output = Command::new(rumdl_exe)
.args(["check", "--no-cache", test_file.to_str().unwrap()])
.output()
.expect("Failed to execute command");
Expand All @@ -506,6 +507,7 @@ Some content
fn test_inline_config_valid_rule_no_warning() {
let temp_dir = tempdir().expect("Failed to create temp dir");
let test_file = temp_dir.path().join("test.md");
let rumdl_exe = env!("CARGO_BIN_EXE_rumdl");

// Create a file with an inline config comment using a valid rule
fs::write(
Expand All @@ -517,7 +519,7 @@ Some content
)
.expect("Failed to write test file");

let output = Command::new("./target/debug/rumdl")
let output = Command::new(rumdl_exe)
.args(["check", "--no-cache", test_file.to_str().unwrap()])
.output()
.expect("Failed to execute command");
Expand All @@ -535,6 +537,7 @@ Some content
fn test_inline_config_warning_silent() {
let temp_dir = tempdir().expect("Failed to create temp dir");
let test_file = temp_dir.path().join("test.md");
let rumdl_exe = env!("CARGO_BIN_EXE_rumdl");

// Create a file with an inline config comment using an unknown rule
fs::write(
Expand All @@ -546,7 +549,7 @@ Some content
)
.expect("Failed to write test file");

let output = Command::new("./target/debug/rumdl")
let output = Command::new(rumdl_exe)
.args(["check", "--no-cache", "--silent", test_file.to_str().unwrap()])
.output()
.expect("Failed to execute command");
Expand All @@ -564,6 +567,7 @@ Some content
fn test_inline_config_warning_suggestion() {
let temp_dir = tempdir().expect("Failed to create temp dir");
let test_file = temp_dir.path().join("test.md");
let rumdl_exe = env!("CARGO_BIN_EXE_rumdl");

// Create a file with an inline config comment using a typo of a valid rule
fs::write(
Expand All @@ -575,7 +579,7 @@ Some content
)
.expect("Failed to write test file");

let output = Command::new("./target/debug/rumdl")
let output = Command::new(rumdl_exe)
.args(["check", "--no-cache", test_file.to_str().unwrap()])
.output()
.expect("Failed to execute command");
Expand All @@ -596,12 +600,13 @@ fn test_inline_config_warning_stdin() {
use std::io::Write;
use std::process::Stdio;

let rumdl_exe = env!("CARGO_BIN_EXE_rumdl");
let content = r#"# Test
<!-- rumdl-disable nonexistent-rule -->
Some content
"#;

let mut child = Command::new("./target/debug/rumdl")
let mut child = Command::new(rumdl_exe)
.args(["check", "--stdin"])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
Expand Down Expand Up @@ -633,6 +638,7 @@ Some content
fn test_inline_config_configure_file_warning() {
let temp_dir = tempdir().expect("Failed to create temp dir");
let test_file = temp_dir.path().join("test.md");
let rumdl_exe = env!("CARGO_BIN_EXE_rumdl");

// Create a file with a configure-file comment using an unknown rule
fs::write(
Expand All @@ -644,7 +650,7 @@ Some content
)
.expect("Failed to write test file");

let output = Command::new("./target/debug/rumdl")
let output = Command::new(rumdl_exe)
.args(["check", "--no-cache", test_file.to_str().unwrap()])
.output()
.expect("Failed to execute command");
Expand All @@ -671,6 +677,7 @@ Some content
fn test_inline_config_markdownlint_variant_warning() {
let temp_dir = tempdir().expect("Failed to create temp dir");
let test_file = temp_dir.path().join("test.md");
let rumdl_exe = env!("CARGO_BIN_EXE_rumdl");

// Create a file with a markdownlint-disable comment using an unknown rule
fs::write(
Expand All @@ -682,7 +689,7 @@ Some content
)
.expect("Failed to write test file");

let output = Command::new("./target/debug/rumdl")
let output = Command::new(rumdl_exe)
.args(["check", "--no-cache", test_file.to_str().unwrap()])
.output()
.expect("Failed to execute command");
Expand Down