Title: [1001] trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java: Improved aliased steps behaviour to be more significant.
Revision
1001
Author
mauro
Date
2008-10-30 03:49:17 -0500 (Thu, 30 Oct 2008)

Log Message

Improved aliased steps behaviour to be more significant.

Modified Paths


Diff

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java (1000 => 1001)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java	2008-10-29 08:28:33 UTC (rev 1000)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java	2008-10-30 08:49:17 UTC (rev 1001)
@@ -23,9 +23,9 @@
         candidateSteps[4].createFrom("Then a then").perform();
         candidateSteps[5].createFrom("Then a then alias").perform();
 
-        ensureThat(steps.given);
-        ensureThat(steps.when);
-        ensureThat(steps.then);
+        ensureThat(steps.givens, equalTo(2));
+        ensureThat(steps.whens, equalTo(2));
+        ensureThat(steps.thens, equalTo(2));
     }
     
     @Test
@@ -73,9 +73,9 @@
     
     public static class MySteps extends Steps {
         
-        private boolean given;
-        private boolean when;
-        private boolean then;
+        private int givens;
+        private int whens;
+        private int thens;
         
         private boolean before;
         private boolean afterAny;
@@ -85,19 +85,19 @@
         @org.jbehave.scenario.annotations.Given("a given")
         @org.jbehave.scenario.annotations.Aliases(values={"a given alias"})
         public void given() {
-            given = true;
+            givens++;
         }
         
         @org.jbehave.scenario.annotations.When("a when")
         @org.jbehave.scenario.annotations.Aliases(values={"a when alias"})
         public void when() {
-            when = true;
+            whens++;
         }
         
         @org.jbehave.scenario.annotations.Then("a then")
         @org.jbehave.scenario.annotations.Aliases(values={"a then alias"})
         public void then() {
-            then = true;
+            thens++;
         }
         
         @org.jbehave.scenario.annotations.BeforeScenario


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to