Skip to content

Closure used as data value in where-block can't be called with method syntax #396

Description

@robfletcher

Originally reported on Google Code with ID 274

expect:
block() == 1

where:
block = { 1 }

groovy.lang.MissingMethodException: No signature of method: MySpec.block() is applicable
for argument types: () values: []

Using block.call() or declaring the data variable as a method parameter solves the
problem (even if the parameter is untyped).

Reported by pniederw on 2012-10-13 11:07:49

Activity

  1. robfletcher commented on Aug 30, 2015

    @robfletcher
    ContributorAuthor
    Possible fix at https://github.com/spockframework/spock/pull/31
    

    Reported by david.dawson@simplicityitself.com on 2013-12-28 22:37:47

  2. robfletcher commented on Aug 30, 2015

    @robfletcher
    ContributorAuthor

    Reported by pniederw on 2013-12-31 14:41:57

    • Status changed: Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions