Skip to content

PollingConditions.eventually should work also if defined with def #1054

@macieg

Description

@macieg

Hi, in the below's example I've provided two tests:
first is going to pass, second is going to fail

The only difference is the way of creating PollingConditions object

class Playground extends Specification {

    def "not boom"() {
        given:
        def conditions = new PollingConditions()

        when:
        def x = 10

        then:
        conditions.eventually {
            1 == 2
        }
    }

    def "boom 2"() {
        given:
        PollingConditions conditions = new PollingConditions()

        when:
        def x = 10

        then:
        conditions.eventually {
            1 == 2
        }
    }
}

Is it expected behavior? There is nothing about it in the documentation of @ConditionBlock, which I strongly believe is related to that (we don't need to write assert keyword in the clojure).

If it's related to groovy itself it might be a good idea to fail when such usage is detected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions