public void setAttribute(String name, Object value) {
    if (setAttributeMethod == null) {
      throw new SpringExtensionException("Method 'TestContext.setAttribute()' was not found");
    }
    ReflectionUtil.invokeMethod(delegate, setAttributeMethod, name, value);
  }
Wrapper around Spring's TestContext class that works with Spring 2.5 and Spring 3.
spock-spring/src/main/java/org/spockframework/spring/SpringTestContext.java