SpockExecutionContext createSpecInstance(SpockExecutionContext context, boolean shared) {
    if (context.getErrorInfoCollector().hasErrors()) return context;

    Specification instance;
    try {
        instance = (Specification) context.getSpec().getReflection().newInstance();
    } catch (Throwable t) {
      throw new InternalSpockError("Failed to instantiate spec '%s'", t).withArgs(context.getSpec().getName());
    }


    context = context.withChildStoreProvider().withCurrentInstance(instance);
    getSpecificationContext(context).setCurrentSpec(context.getSpec());

    // this is either for the shared spec instance or the current iteration
    getSpecificationContext(context).setStoreProvider(context.getStoreProvider());
    if (shared) {
      context = context.withSharedInstance(instance);
    }
    getSpecificationContext(context).setSharedInstance(context.getSharedInstance());
    return context;
  }
Executes a single Spec. Notifies its supervisor about overall execution
progress and every invocation of Spec code.
Supervisor also determines the error strategy.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/runtime/PlatformSpecRunner.java