Skip to content

Instantly share code, notes, and snippets.

@robsquires
Created March 17, 2013 17:41
Show Gist options
  • Save robsquires/5182695 to your computer and use it in GitHub Desktop.
Save robsquires/5182695 to your computer and use it in GitHub Desktop.
For the given gherkin feature the standard step definitions are matching not problem. However, the @Transform is not being matched. Is the syntax correct?
for the given scenario:
Scenario: I can drill down by product line
Given I have searched for "light sources"
And I have selected the category "led"
When I select the product line "Track 3"
Then I should see products:
| name |
| Test Product 3 |
| Test Product 5 |
this is being matched:
/**
* @When /^I select the (category) "([^"]*)"$/
* @When /^I select the (product line) "([^"]*)"$/
* @Given /^I have selected the (category) "([^"]*)"$/
*/
public function filterByThe($filter, $value){)
BUT this is not being matched:
/**
* @Transform /product line "([^"]*)"/
*/
public function lookupProductLine($name){}
@robsquires
Copy link
Author

You're right, I misunderstood exactly that. I've changed this to:

/**
* @When /^I select the (product line "([^"]*)")$/
*/
public function selectTheProductLine(ProductLine $productLine){)

/**
* @When /^I select the (category "([^"]*)")$/
* @Given /^I have selected the (category "([^"]*)")$/
*/
public function filterByTheCategory(Category $category){)

...and works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment