Skip to content

Commit

Permalink
new feature file
Browse files Browse the repository at this point in the history
  • Loading branch information
konserw committed Sep 13, 2017
1 parent 97f23cf commit f7bac5c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 72 deletions.
79 changes: 79 additions & 0 deletions features/specific/boost_specific.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
@boost
Feature: Check macros used with boost test driver

This is just a simple feature meant to test boost's
specyfic validation macros interop with cucumber.

Scenario Outline: <check> macro
Given the following feature:
"""
Feature: Feature name
Scenario: Scenario name
Given a step
"""
And a step definition file with:
"""
#include <boost/test/unit_test.hpp>
#include <cucumber-cpp/autodetect.hpp>
GIVEN("a step") {
<check>(false);
}
"""
When Cucumber runs the feature
Then the scenario <passes or fails?>

Examples:
| check | passes or fails? |
| BOOST_WARN | passes |
| BOOST_CHECK | fails |
| BOOST_REQUIRE | fails |


Scenario Outline: <check> macro
Given the following feature:
"""
Feature: Feature name
Scenario: Scenario name
Given a step
"""
And a step definition file with:
"""
#include <boost/test/unit_test.hpp>
#include <cucumber-cpp/autodetect.hpp>
GIVEN("a step") {
<check>(false, "boost message");
}
"""
When Cucumber runs the feature
Then the scenario <passes or fails?>

Examples:
| check | passes or fails? |
| BOOST_WARN_MESSAGE | passes |
| BOOST_CHECK_MESSAGE | fails with message "boost message" |
| BOOST_REQUIRE_MESSAGE | fails with message "boost message" |


Scenario Outline: <check> macro
Given the following feature:
"""
Feature: Feature name
Scenario: Scenario name
Given a step
"""
And a step definition file with:
"""
#include <boost/test/unit_test.hpp>
#include <cucumber-cpp/autodetect.hpp>
GIVEN("a step") {
<check>("boost message");
}
"""
When Cucumber runs the feature
Then the scenario <passes or fails?>

Examples:
| check | passes or fails? |
| BOOST_ERROR | fails with message "boost message" |
| BOOST_FAIL | fails with message "boost message" |

72 changes: 0 additions & 72 deletions features/specific/predicate_message.feature

This file was deleted.

6 changes: 6 additions & 0 deletions features/step_definitions/cucumber_cpp_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
Then /^a step definition snippet with (".*") is suggested$/ do |regex_string|
assert_partial_output("(#{regex_string}) {", all_output)
end

Then /^the scenario fails with message "([^"]*)"$/ do |message|
assert_partial_output(message, all_output)
assert_success false
end

0 comments on commit f7bac5c

Please sign in to comment.