News for hackers. Stuff that matters.
Re:Rise and fall of JVM languages by dvlsg on Monday August 21, 2017 @12:26PM (#15065680)
What do you miss that's not in F#? Legitimately curious, since F# is the language I miss (or wish to use, I suppose) the most at the moment.
Re:Rise and fall of JVM languages by tigershark on Monday August 21, 2017 @11:56PM (#15069574)
It's the overall experience that is great. Creating a stub or a mock with just: IMyService myService = Stub() // Mock()

Returning something from the stub:

myService.getData() >> data

verifying the returned value without explicit assert:

result == expected (This will show a very informative error in case of mismatch and gives you the ability to see the differences in a diff style window)

Interaction based testing is a breeze with this:

3 * myService.getData()

1 * myOtherService.getData()

And finally the data driven testing is the most natural that I have ever seen. You just need to literally create a table and use the column name in your test or even in your test title. Writing tests becomes a joy with Spock.

In F# I have looked at expecto, fsunit and some other library, but I can't find anything remotely equivalent.