From 2b39738d04024a0ac507d690dd24f7d9b8fbd549 Mon Sep 17 00:00:00 2001 From: azzam Date: Sat, 20 Feb 2021 04:06:21 +0700 Subject: [PATCH] test: invalid domain Check for invalid domain such `example` instead of `example.com` --- tests/integration_test.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 3542c35..3c0d0f9 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -67,6 +67,17 @@ fn address_invalid() { .stderr(predicate::str::contains("Invalid addres")); } +#[test] +fn domain_invalid() { + let mut cmd = Command::cargo_bin("digs").unwrap(); + cmd.arg("example") + .arg("-f") + .arg("tests/fixture/invalid-address.toml"); + cmd.assert() + .failure() + .stderr(predicate::str::contains("Invalid domain name")); +} + #[test] fn query() { let mut cmd = Command::cargo_bin("digs").unwrap();