@Nullable
  private DelegatingScript loadScriptFromClassPathLocation(String location) {
    URL url = this.getClass().getClassLoader().getResource(location);
    if (url == null) return null;

    GroovyShell shell = createShell();
    GroovyCodeSource codeSource = null;
    // try block below for compatibility pre/post Groovy 2.4.7 (see GROOVY-8126)
    try {
      codeSource = new GroovyCodeSource(url);
    } catch (Exception e) {
      throw new ConfigurationException("Error reading configuration script '%s'", location);
    }
    try {
      return (DelegatingScript) shell.parse(codeSource);
    } catch (CompilationFailedException e) {
      throw new ConfigurationException("Error compiling configuration script '%s'", location);
    }
  }
For testing purposes. Do not use directly.
spock-core/src/main/java/org/spockframework/runtime/ConfigurationScriptLoader.java