use of org.gradle.util.TestClosure in project gradle by gradle.
the class DefaultDomainObjectCollectionTest method canExecuteClosureForAllElementsInATypeFilteredCollection.
// @Test
// public void canExecuteActionForAllElementsInATypeFilteredCollection() {
// final Action<CharSequence> action = context.mock(Action.class);
//
// container.add("c");
// container.add(new StringBuffer("b"));
//
// context.checking(new Expectations(){{
// one(action).execute("c");
// one(action).execute("a");
// }});
//
// container.withType(String.class, action);
// container.add("a");
// }
@Test
public void canExecuteClosureForAllElementsInATypeFilteredCollection() {
final TestClosure closure = context.mock(TestClosure.class);
container.add("c");
container.add(new StringBuffer("b"));
context.checking(new Expectations() {
{
oneOf(closure).call("c");
oneOf(closure).call("a");
}
});
container.withType(String.class, TestUtil.toClosure(closure));
container.add("a");
}
Aggregations