mardi 27 février 2018

kotlin: how to inherit from Spek class

I want to have a common fixture for my tests:

@RunWith(JUnitPlatform::class)
abstract class BaseSpek: Spek({

    beforeGroup {println("before")}

    afterGroup {println("after")}
})

and now I want to use that spec:

class MySpek: BaseSpek({
    it("should xxx") {}
})

but i got compilation error due to no-arg BaseSpek constructor. what's the correct way of achieving what i need?

Aucun commentaire:

Enregistrer un commentaire