Skip to content

Commit 442922b

Browse files
Adrian Bakermpkorstanje
Adrian Baker
authored andcommitted
Split test in two.
1 parent 9d71605 commit 442922b

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

core/src/test/java/cucumber/runner/RunnerTest.java

+11-15
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,20 @@ public void hooks_execute_also_after_failure() throws Throwable {
8282
inOrder.verify(beforeHook).execute(Matchers.<Scenario>any());
8383
inOrder.verify(afterHook).execute(Matchers.<Scenario>any());
8484
}
85+
86+
@Test
87+
public void steps_are_executed() throws Throwable {
88+
final StepDefinition stepDefinition = mock(StepDefinition.class);
89+
runtime.getRunner().runPickle(createPickleEventMatchingStepDefinitions(asList(stepDefinition), runtime));
90+
verify(stepDefinition).execute(Matchers.anyString(), Matchers.<Object[]>any());
91+
}
8592

8693
@Test
8794
public void steps_are_not_executed_on_dry_run() throws Throwable {
88-
// Step without dry-run flag should be executed once
89-
{
90-
StepDefinition stepDefinition = mock(StepDefinition.class);
91-
Runtime runtime = createRuntime(backend);
92-
runtime.getRunner().runPickle(createPickleEventMatchingStepDefinitions(asList(stepDefinition), runtime));
93-
verify(stepDefinition).execute(Matchers.anyString(), Matchers.<Object[]>any());
94-
}
95-
96-
// Same step with dry-run flag should not be executred
97-
{
98-
StepDefinition stepDefinition = mock(StepDefinition.class);
99-
Runtime dryRuntime = createRuntime(backend, "--dry-run");
100-
dryRuntime.getRunner().runPickle(createPickleEventMatchingStepDefinitions(asList(stepDefinition), dryRuntime));
101-
verify(stepDefinition, never()).execute(Matchers.anyString(), Matchers.<Object[]>any());
102-
}
95+
final StepDefinition stepDefinition = mock(StepDefinition.class);
96+
final Runtime dryRuntime = createRuntime(backend, "--dry-run");
97+
dryRuntime.getRunner().runPickle(createPickleEventMatchingStepDefinitions(asList(stepDefinition), dryRuntime));
98+
verify(stepDefinition, never()).execute(Matchers.anyString(), Matchers.<Object[]>any());
10399
}
104100

105101
@Test

0 commit comments

Comments
 (0)