Move InMemory database spec to shared example.