When trying to mock a method declared as
def foo: Int
with
val mock = mock[MyClass]
(mock.foo _).expects().returning(10)
I get an error
Error: Methods without a parameter list and by-name params can no longer be converted to functions as `m _`, write a function literal `() => m` instead
There's a tip to write a function literal instead but I don't quite understand how to convert my code into an equivalent function literal.