Open chris-zen opened 6 years ago
Same issue here, I think I'll choose another library.
this works for me (am able to refer to PipelineClient as a type):
val tmp = mock[RedisClient]
def pipeline(f: tmp.PipelineClient => Any): Option[List[Any]] = {
// ...
}
I also encountered this... PipelineClient is documented but not accessible. Not sure I understand the why you wouldn't at least expose this as a trait? Unless we should just be using RedisCommand?
I have a function like:
Given that the type of
pipe
isRedisClient.this.PipelineClient
andPipelineClient
is an Inner Class, it is not possible to write something like this in a test (the code doesn't compile because it is not possible to import PipelineClient):I see that
PipelineClient
is implemented as an Inner Class, but used as an Static Class, as it receives a reference to its parent, and all the accesses to it are done through the reference.I am wondering if it could be possible to make
PipelineClient
anstatic class
so pipelining can be easily mocked. I could prepare the PR if you wish.