Skip to content

Commit 994133a

Browse files
Simplify load_client_config tests
Co-authored-by: jpoehnelt <3392975+jpoehnelt@users.noreply.github.com>
1 parent b2467a1 commit 994133a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/oauth_config.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ mod tests {
238238

239239
// Initially no config file exists
240240
let result = load_client_config();
241-
assert!(result.is_err());
242-
assert!(result.unwrap_err().to_string().contains("Cannot read"));
241+
let err = result.unwrap_err();
242+
assert!(err.to_string().contains("Cannot read"));
243243

244244
// Create a valid config file
245245
save_client_config("test-id", "test-secret", "test-project").unwrap();
@@ -255,10 +255,10 @@ mod tests {
255255
std::fs::write(&path, "invalid json").unwrap();
256256

257257
let result = load_client_config();
258-
assert!(result.is_err());
259-
assert!(result
260-
.unwrap_err()
261-
.to_string()
262-
.contains("Invalid client_secret.json format"));
258+
let err = result.unwrap_err();
259+
assert!(
260+
err.to_string()
261+
.contains("Invalid client_secret.json format")
262+
);
263263
}
264264
}

0 commit comments

Comments
 (0)