Skip to content

Migrate to BDD tests #65

@KarthikRIyer

Description

@KarthikRIyer

This discussion begain in #57

We should adopt BDD Testing, atleast for complicated test cases, requiring some documentation.

The BDD specification would be like:

given: "An item is created"
when: "Item is disabled"
then: "Item does not contribute to the composition"

And the code would be like:

given: "An item is created"
def item = new Item()
verify {
    item.enabled() == true
}

when: "Item is disabled"
item.setEnabled(false)

then: "Item does not contribute to the composition"
verifyAll {
        item.isEnabled() == false
}

BDD tests can be written using the spock framework.
Spock also has an extension spock-reports that generates nice HTML test reports.
image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions