added test for method def pattern