dimanche 17 décembre 2017

Writing a parameterized test method in spock

I'm writing a test in spock and currently this is the base structure:

def "someTest"(String str, Class<? extends SomeClass> clazz) {

    setup:
    ...

    when:
    ...

    then:
    ...
}

I need to use str and clazz in setup, when and then and so I need a way to call the method multiple times.

I've already read some tuts online: http://ift.tt/2B87uN3 but really have no idea on how to implement it with non-primitive types

Aucun commentaire:

Enregistrer un commentaire