Skip to content

Commit 1ff54c2

Browse files
committed
fix test
1 parent 7f0be90 commit 1ff54c2

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

docs/src/managers/cacache.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ First construct your manager instance. This example will use the default cache d
2626
let manager = CACacheManager::default();
2727
```
2828

29-
You can also specify the cache directory.
29+
You can also specify the cache directory and if you want the cache entries to be removed fully from disk.
3030

3131
```rust
32-
let manager = CACacheManager {
33-
path: "./my-cache".into(),
34-
};
32+
let manager = CACacheManager::new("./my-cache".into(), true);
3533
```
3634

3735
You can attempt to retrieve a record from the cache using the `get` method. This method accepts a `&str` as the cache key and returns an `Result<Option<(HttpResponse, CachePolicy)>, BoxError>`.

http-cache/src/test.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,7 @@ mod with_cacache {
188188
#[async_test]
189189
async fn cacache() -> Result<()> {
190190
let url = Url::parse("http://example.com")?;
191-
let manager = CACacheManager { path: "./http-cacache-test".into() };
192-
assert_eq!(
193-
&format!("{:?}", manager),
194-
"CACacheManager { path: \"./http-cacache-test\" }"
195-
);
191+
let manager = CACacheManager::new("./http-cacache-test".into(), true);
196192
let http_res = HttpResponse {
197193
body: TEST_BODY.to_vec(),
198194
headers: Default::default(),

0 commit comments

Comments
 (0)