Skip to content
Browse files

Changing the Hook to a B or A depending on what type

  • Loading branch information...
1 parent 842ffc7 commit 5d45221469ac5df5bb8d7ddd233abe077a6aee86 @dkowis committed Apr 17, 2012
Showing with 12 additions and 9 deletions.
  1. +12 −9 core/src/main/java/cucumber/formatter/ProgressFormatter.java
View
21 core/src/main/java/cucumber/formatter/ProgressFormatter.java
@@ -7,7 +7,6 @@
import gherkin.formatter.model.Background;
import gherkin.formatter.model.Examples;
import gherkin.formatter.model.Feature;
-import gherkin.formatter.model.HookResult;
import gherkin.formatter.model.Match;
import gherkin.formatter.model.Result;
import gherkin.formatter.model.Scenario;
@@ -101,21 +100,25 @@ public void result(Result result) {
@Override
public void before(HookResult result) {
- handleHook(result);
+ handleHook(result, true);
}
@Override
public void after(HookResult result) {
- handleHook(result);
+ handleHook(result, false);
}
-
- private void handleHook(HookResult result){
- if(result.getStatus().equals(Result.FAILED)) {
- if(!monochrome){
+
+ private void handleHook(HookResult result, boolean before) {
+ if (result.getStatus().equals(Result.FAILED)) {
+ if (!monochrome) {
ANSI_ESCAPES.get(result.getStatus()).appendTo(out);
}
- out.append("H"); //TODO: H for hook?
- if(!monochrome) {
+ if (before) {
+ out.append("B");
+ } else {
+ out.append("A");
+ }
+ if (!monochrome) {
AnsiEscapes.RESET.appendTo(out);
}
}

0 comments on commit 5d45221

Please sign in to comment.
Something went wrong with that request. Please try again.