From f933656161bf74e8df553ef3d8317e95e26d0b4e Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 10 Jan 2024 00:10:22 +0100 Subject: [PATCH] Add integration test for `accept` (int and string) --- fixtures/configs/accept.toml | 1 + lychee-bin/tests/cli.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 fixtures/configs/accept.toml diff --git a/fixtures/configs/accept.toml b/fixtures/configs/accept.toml new file mode 100644 index 0000000..6dff868 --- /dev/null +++ b/fixtures/configs/accept.toml @@ -0,0 +1 @@ +accept = [200, "203", "301..=304", 404] \ No newline at end of file diff --git a/lychee-bin/tests/cli.rs b/lychee-bin/tests/cli.rs index a21c795..e71ea95 100644 --- a/lychee-bin/tests/cli.rs +++ b/lychee-bin/tests/cli.rs @@ -653,6 +653,20 @@ mod cli { .success(); } + #[tokio::test] + async fn test_config_accept() { + let mock_server = mock_server!(StatusCode::OK); + let config = fixtures_path().join("configs").join("accept.toml"); + let mut cmd = main_command(); + cmd.arg("--config") + .arg(config) + .arg("-") + .write_stdin(mock_server.uri()) + .env_clear() + .assert() + .success(); + } + #[test] fn test_lycheeignore_file() -> Result<()> { let mut cmd = main_command();