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

Provide block label in failure output #923

Open
masooh opened this Issue Sep 28, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@masooh

masooh commented Sep 28, 2018

It would be great to see the block label belonging to the failing assertion. Below added the new line beginning with the word Context:

Context: 'there are still three elements'
Condition not satisfied:

numbers.size() == 2
|       |      |
|       3      false
[1, 2, 3]

Expected :2

Actual   :3

With that it would be easier to understand the context of the failure message without looking at the code.

Sample feature for the failure above:

def "test set modification"() {
    given: 'a set with three element'
    Set numbers = [1, 2, 3]

    when: 'adding an existing element'
    numbers.add(2)

    then: 'there are still three elements'
    numbers.size() == 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment