Skip to content

Commit ec16d01

Browse files
committed
Clean up some code in PlatformSpecRunner
- In 'runFeature', the 'if (currentFeature.isSkipped())' code block is unnecessary, because it will never be executed, as 'runFeature' also will not be executed for skipped features. - In 'runSpec', add 'if (spec.isExcluded()) return;' analogous to the existing 'if (currentFeature.isExcluded()) return;' in 'runFeature', logically aligning the code structures in both methods. Relates to #1662.
1 parent 3651263 commit ec16d01

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

spock-core/src/main/java/org/spockframework/runtime/PlatformSpecRunner.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public void runSpec(SpockExecutionContext context, Runnable specRunner) {
5151
if (context.getErrorInfoCollector().hasErrors()) return;
5252

5353
SpecInfo spec = context.getSpec();
54+
if (spec.isExcluded()) return;
55+
5456
supervisor.beforeSpec(spec);
5557
invoke(context, this, createMethodInfoForDoRunSpec(context, specRunner));
5658
supervisor.afterSpec(spec);
@@ -183,11 +185,6 @@ public void runFeature(SpockExecutionContext context, Runnable feature) {
183185
FeatureInfo currentFeature = context.getCurrentFeature();
184186
if (currentFeature.isExcluded()) return;
185187

186-
if (currentFeature.isSkipped()) {
187-
supervisor.featureSkipped(currentFeature); // todo notify in node isSkipped
188-
return;
189-
}
190-
191188
supervisor.beforeFeature(currentFeature);
192189
invoke(context, this, createMethodInfoForDoRunFeature(context, feature));
193190
supervisor.afterFeature(currentFeature);

0 commit comments

Comments
 (0)