Core tests open their store through local::memory_conn
Seven test modules each built a migrated in-memory store by hand: open, migrate, and (in sharing) wrap it in a Db. local::memory_conn() is that, and open_in_memory uses it too. Each module's db() is now one line, and the schema, Connection and Mutex imports it needed are gone. DRY pass #2, batch 2, F9 (#5372). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -593,11 +593,9 @@ fn dirname(path: &str) -> &str {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::local::schema;
|
||||
|
||||
fn store() -> (Connection, BlobStore, std::path::PathBuf) {
|
||||
let conn = Connection::open_in_memory().unwrap();
|
||||
schema::migrate(&conn).unwrap();
|
||||
let conn = crate::local::memory_conn().unwrap();
|
||||
let dir = std::env::temp_dir().join(format!("inkwell-portable-{}", uuid::Uuid::new_v4()));
|
||||
let blobs = BlobStore::new(dir.clone()).unwrap();
|
||||
(conn, blobs, dir)
|
||||
|
||||
Reference in New Issue
Block a user