Skip to content

Commit

Permalink
Add scenario for passing with output
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Aug 9, 2016
1 parent 106ec5b commit 9a4e539
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions features/testing_behat_in_behat.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ Feature: Testing Behat in Behat
contexts:
- FriendsOfBehat\TestContext\Context\TestContext
"""

Scenario:
Given a feature file "features/test.feature" containing:
"""
Feature: Passing feature
Scenario: Passing scenario
Then it passes
"""
And a context file "features/bootstrap/FeatureContext.php" containing:
"""
<?php
Expand All @@ -31,7 +22,33 @@ Feature: Testing Behat in Behat
{
/** @Then it passes */
public function itPasses() {}
/** @Then it passes with output :output */
public function itPassesWithOutput($output) { echo $output; }
}
"""

Scenario: Passing scenario
Given a feature file "features/test.feature" containing:
"""
Feature: Passing feature
Scenario: Passing scenario
Then it passes
"""
When I run Behat
Then it should pass

Scenario: Passing scenario with output
Given a feature file "features/test.feature" containing:
"""
Feature: Passing feature with output
Scenario: Passing scenario with output
Then it passes with output "Krzysztof Krawczyk"
"""
When I run Behat
Then it should pass with:
"""
Krzysztof Krawczyk
"""

0 comments on commit 9a4e539

Please sign in to comment.