diff --git a/test/specs/method_test.dart b/test/specs/method_test.dart index 0f2e093..297afeb 100644 --- a/test/specs/method_test.dart +++ b/test/specs/method_test.dart @@ -590,4 +590,19 @@ void main() { '''), ); }); + + test('should create a method as a closure', () { + expect( + Method( + (b) => b + ..requiredParameters.add( + Parameter((b) => b..name = 'a'), + ) + ..body = const Code(''), + ).closure, + equalsDart(r''' + (a) { } + '''), + ); + }); }