Here's a simple working example:

Story:

Scenario: Outcome fail
Given nothing
When nothing
Then the result should be 2001-01-01

Steps:

public class OutcomesDateFailSteps {
    @Given("nothing")
    @When("nothing")
    public void nothing() {
    }

    @Then("the result should be $date")
    public void result(@Named("date") Date result) {
        OutcomesTable out = new OutcomesTable();

        out.addOutcome("A failing date", result, Matchers.equalTo(new Date()));

        out.verify();
    }

    @AsParameterConverter
    public Date createDate(String name) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.parse(name);
    }
}
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to