Skip to content

Commit

Permalink
Revert "checking for dry run option before running hooks."
Browse files Browse the repository at this point in the history
This reverts commit a5ace1a.
  • Loading branch information
wjpowell committed Jan 2, 2013
1 parent a5ace1a commit d347213
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
6 changes: 2 additions & 4 deletions core/src/main/java/cucumber/runtime/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,8 @@ public void runAfterHooks(Reporter reporter, Set<Tag> tags) {
}

private void runHooks(List<HookDefinition> hooks, Reporter reporter, Set<Tag> tags, boolean isBefore) {
if (!runtimeOptions.dryRun) {
for (HookDefinition hook : hooks) {
runHookIfTagsMatch(hook, reporter, tags, isBefore);
}
for (HookDefinition hook : hooks) {
runHookIfTagsMatch(hook, reporter, tags, isBefore);
}
}

Expand Down
17 changes: 2 additions & 15 deletions core/src/test/java/cucumber/runtime/RuntimeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,29 +153,16 @@ public void non_strict_with_errors() {

assertEquals(0x1, runtime.exitStatus());
}

@Test
public void dry_run_set() {
Runtime runtime = createDryRunRuntime();
runtime.addError(new RuntimeException());

assertEquals(0x1, runtime.exitStatus());
}


@Test
@Test
public void strict_with_errors() {
Runtime runtime = createStrictRuntime();
runtime.addError(new RuntimeException());

assertEquals(0x1, runtime.exitStatus());
}

private Runtime createDryRunRuntime() {
return createRuntime("--dry-run");
}

private Runtime createStrictRuntime() {
private Runtime createStrictRuntime() {
return createRuntime("-g anything", "--strict");
}

Expand Down

0 comments on commit d347213

Please sign in to comment.