cucumber/cucumber-jvm — Issue #223: @Given & @When with same regexp results in error
Author: hutchy2570
Created: 2012-02-27 14:42:10+00:00
State: open

When I have a @Given and a @When step definition with the same regexp I get a duplicate step definition error.

---

Example with 1.0.0-RC16:

Scenario: Test duplicate steps
Given I do something
When I do something

@Given("^I do something$")
public void givenIDoSomething() {
//Do something
}

@When("^I do something$")
public void whenIDoSomething() {
//Do something
}

Gives the result:

Exception in thread "main" cucumber.runtime.DuplicateStepDefinitionException: Duplicate step definitions in Steps.givenIDoSomething() and Steps.whenIDoSomething()

---

These step definitions should be treated as different due to the @Given & @When annotations, but they are not.