blob: 7f9a07ef99d9ca517c8f2b18577c074d4af2cf1c [file] [log] [blame]
package org.codehaus.groovy.classgen
import groovy.util.GroovyTestCase
/**
* @author Guillaume Laforge
*/
class CallClosureFieldAsMethodTest extends GroovyTestCase {
String firstname = "Guillaume"
closureMethod = { |greeting| "${greeting} ${firstname}" }
/**
* Check that we can call a closure defined as a field as if it were a normal method
*/
void testCallToClosureAsMethod() {
obj = new CallClosureFieldAsMethodTest()
assert obj.closureMethod("Hello") == "Hello Guillaume"
}
}