~ubuntu-branches/ubuntu/lucid/groovy/lucid

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package groovy

class NamedParameterTest extends GroovyTestCase {

    void testPassingNamedParametersToMethod() {
        someMethod(name:"gromit", eating:"nice cheese", times:2)
    }
    
    protected void someMethod(args) {
        assert args.name == "gromit"
        assert args.eating == "nice cheese"
        assert args.times == 2
        assert args.size() == 3
    }
}