Skip to content

Commit 2e7ea84

Browse files
committed
Minor refactor in auth_file_watcher tests
1 parent 8c8ede8 commit 2e7ea84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/auth_file_watcher.test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use chrono::Local;
55
use crate::auth_file_watcher::AuthFileWatcher;
66
use crate::test_utils::test_file::{rename_file, TestFile};
77

8-
const AUTH_FAILED_MESSAGES: [&str; 6] = [
8+
const TEST_MESSAGES: [&str; 6] = [
99
"workstation sudo: pam_unix(sudo:auth): authentication failure; logname=john uid=1000 euid=0 tty=/dev/pts/7 ruser=john rhost= user=john",
1010
"workstation kscreenlocker_greet: pam_unix(kde:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost= user=john",
1111
"workstation dbus-daemon[1988]: [system] Failed to activate service 'org.bluez': timed out (service_start_timeout=25000ms)",
@@ -36,7 +36,7 @@ fn expect_update_callback_is_called_when_file_is_modified(
3636
) {
3737
let mut call_count = 0;
3838
for i in 0..10 {
39-
let message = AUTH_FAILED_MESSAGES[i % AUTH_FAILED_MESSAGES.len()];
39+
let message = TEST_MESSAGES[i % TEST_MESSAGES.len()];
4040
let line_to_add = create_log_line(message);
4141
file.write(&line_to_add);
4242
auth_file_watcher.update(|line| {
@@ -61,7 +61,7 @@ fn when_more_than_one_line_is_added_then_update_callback_is_called_for_each_line
6161

6262
let mut call_count = 0;
6363
for i in 0..10 {
64-
let lines_to_add = AUTH_FAILED_MESSAGES.map(create_log_line);
64+
let lines_to_add = TEST_MESSAGES.map(create_log_line);
6565
for line in &lines_to_add {
6666
file.write(line)
6767
}

0 commit comments

Comments
 (0)