diff options
Diffstat (limited to 'src/registry.rs')
| -rw-r--r-- | src/registry.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/registry.rs b/src/registry.rs index b18c1eb..173f8a7 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -334,6 +334,7 @@ struct StubTag { #[cfg(test)] pub struct StubRegistry { entries: RefCell<Vec<StubTag>>, + pub tags_calls: RefCell<HashMap<(String, String), usize>>, } #[cfg(test)] @@ -341,6 +342,7 @@ impl Default for StubRegistry { fn default() -> Self { return StubRegistry { entries: RefCell::new(vec![]), + tags_calls: RefCell::new(HashMap::new()), }; } } @@ -369,6 +371,10 @@ impl StubRegistry { #[cfg(test)] impl Registries for StubRegistry { fn get_tags(&self, registry: &str, image: &str) -> Option<Vec<String>> { + *self.tags_calls.borrow_mut() + .entry((registry.to_string(), image.to_string())) + .or_insert(0) += 1; + let mut tags = vec![]; let mut found = false; |
