Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to BDD tests #65

Open
KarthikRIyer opened this issue Mar 19, 2022 · 0 comments
Open

Migrate to BDD tests #65

KarthikRIyer opened this issue Mar 19, 2022 · 0 comments

Comments

@KarthikRIyer
Copy link
Contributor

KarthikRIyer commented Mar 19, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant