This project is read-only.

Incorrect parsing of Examples section from feature file

Nov 6, 2012 at 5:55 PM

Hi All,

In Examples I found the following example of parameterization:

Feature: add, subtract, divide and multiply

Scenario: Add numbers
	Given I have entered [num1] into the calculator
	And I have entered [num2] into the calculator
	When I add the numbers
	Then the sum should be [result]
|   1|   2|     3|
|  -1|   2|     1|
|   1|  -2|    -1|
|  -2|  -3|    -5|

But In my feature file I use few parameters in one string and it does not work. See example below. Looks like nbehave take first parameter from the "Examples" section in the file and put the same value in all places regardless the names of parameters are different. For example, I have follwoing feature file:

Feature: Common

Scenario: No error

Given I am not logged in

When I log in as [email] with a password [password]






So here nbehave takes "" and put it in both email and password fields.

Does somebody have an idea why this is happenning? Need more details?

Nov 6, 2012 at 10:27 PM

What version of nbehave are you using?
How does your implementation of the steps look like?

If I run that feature file against the latest build with the following step implementations:

    public class MySteps
        [Given("I am not logged in")]
        public void Given_I_am_not_logged_in()
        { }

        [When("I log in as [email] with a password [password]")]
        public void When_I_log_in_as_email_with_a_password_password(string email, string password)
            Assert.AreEqual("", email);
            Assert.AreEqual("passphrase", password);

        [Then("I'm logged in")]
        public void Then_I_m_logged_in()
        {  }
Then all work fine on my machine.

Nov 8, 2012 at 2:28 PM

Thank you so much. It works for now without NBehave update. Looks like a temporary glitch.