https://kotlinlang.org logo
#spek
Title
k

kasper.kondzielski

11/21/2017, 11:23 AM
@dsgryazin If I may join 😉 I’ve tried and it was cool but it wasn’t sufficient because it didn’t allow to have unlimited nesting of test cases. On the other hand it was very easy to write custom Specification which does based on its based specification class. (But it performed poorly)
d

dsgryazin

11/21/2017, 11:25 AM
Thanks for reply! If you have any open sources test to look at, that would be great=)
k

kasper.kondzielski

11/21/2017, 11:27 AM
Unfortunately it was on private repository 😞
d

dsgryazin

11/21/2017, 11:33 AM
We do practise spek in non android targets. I personally agree with the spock ideology, that deep nesting is not a scalabe solution. https://github.com/spockframework/spock/issues/106
Wonder if someone used to test complicated, very stateful stuff with spek and if it was ok in maintenance
k

kasper.kondzielski

11/21/2017, 11:36 AM
We used this kotlin-tests with our custom spec to test IMO quite complicated state machine and it was very good, mainly because of those nestings
👍 1
Here is a snippet from our code base:
Copy code
assertBluetoothDialogGone()
            assertLoaderVisible()
            assertMapSelectorGone()
            assertMapVisible(firstMap)
            nestTestWithBefore("and map is loaded", { events.accept(OfficeMap.Event.MapLoaded) }) {
                andMapSelectorOpened {
                    assertMapSelectorVisible()
                    andMapIsSelected(secondMap) {
                        assertMapVisible(secondMap)
                        assertMapSelectorGone()
                        andApiReturnsError {
                            assertDefaultErrorVisible()
Hard to past it here so it looks equally good as in idea but I hope you get the point.
👍 1