SHARE
TWEET

Closure fails in Grails 3 but not 2

a guest Jul 17th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package closureparameter
  2.  
  3. import grails.test.mixin.TestMixin
  4. import grails.test.mixin.support.GrailsUnitTestMixin
  5. import spock.lang.Specification
  6.  
  7. @TestMixin(GrailsUnitTestMixin)
  8. class HestSpec extends Specification {
  9.     void "test closures"() {
  10.         setup:
  11.         def closure2 = { Date x, String y -> return y }
  12.         Object[] arguments1 = [new Date(), "Some String"]
  13.  
  14.         expect:
  15.         closure2.call(arguments1) == 'Some String'
  16.     }
  17. }
RAW Paste Data
Top