I don't think a Mock Slick Driver exists yet. You could consider writing
it. It should not be too hard, but may be a challenge being new to
Scala. Here is info to help:
We do have an in-memory driver in 2.0 that works on collections. It is
not very well tested in practice, but that's irrelevant here. You could
just copy and paste it as a foundation and change the code to make it a
mock-driver.
The code is here
https://github.com/slick/slick/blob/master/src/main/scala/scala/slick/memory/MemoryProfile.scala
You will have to build your own executors and invokers to return mock
data instead of execution results. We are in the process of migrating
from the invoker model to the executor model, the former of which may be
fully replaced by the latter some time next year.
Executor and invoker follow the virtual class pattern. (The theory of it
is explained here if needed:
http://lampwww.epfl.ch/~odersky/papers/ScalableComponent.html)
The gist is (just as it is done in MemoryProfile/MemoryDriver):
1. Subclass the QueryExecutorDef of the super-class and override methods
as desired (replacing them by your mock logic).
2. Implement the factory method used by Slick to create one when needed.
def createQueryExecutor
3. "Tie the knot" on the virtual class by defining the corresponding
abstract type as your customized subclass:
type QueryExecutor[R] = QueryExecutorDef[R]
This way you get .run to work and mockable. For now we only have
InsertInvoker in MemoryProfile. No update support and for the (soon to
be deprecated) .list method. We may lift that restriction in the not so
far future, but no promises. We also accept PRs. Though expect strong
opinions and quite some discussion on this one as it is a core component
of Slick.
This is all 2.0, but using 2.0 is a good decision anyways if you are
just starting out with the project. Then you don't need to migrate very
soon. Updated documentation will be released before Christmas.
If you are going to try this, please consider open sourcing it early as
you go. This will be useful for other people and that way you can get
feedback from us or others. Also on your Scala code since you are rather
new.
Good luck :),
Chris