Skip to content

Commit f7bac5c

Browse files
committed
new feature file
1 parent 97f23cf commit f7bac5c

File tree

3 files changed

+85
-72
lines changed

3 files changed

+85
-72
lines changed
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
@boost
2+
Feature: Check macros used with boost test driver
3+
4+
This is just a simple feature meant to test boost's
5+
specyfic validation macros interop with cucumber.
6+
7+
Scenario Outline: <check> macro
8+
Given the following feature:
9+
"""
10+
Feature: Feature name
11+
Scenario: Scenario name
12+
Given a step
13+
"""
14+
And a step definition file with:
15+
"""
16+
#include <boost/test/unit_test.hpp>
17+
#include <cucumber-cpp/autodetect.hpp>
18+
GIVEN("a step") {
19+
<check>(false);
20+
}
21+
"""
22+
When Cucumber runs the feature
23+
Then the scenario <passes or fails?>
24+
25+
Examples:
26+
| check | passes or fails? |
27+
| BOOST_WARN | passes |
28+
| BOOST_CHECK | fails |
29+
| BOOST_REQUIRE | fails |
30+
31+
32+
Scenario Outline: <check> macro
33+
Given the following feature:
34+
"""
35+
Feature: Feature name
36+
Scenario: Scenario name
37+
Given a step
38+
"""
39+
And a step definition file with:
40+
"""
41+
#include <boost/test/unit_test.hpp>
42+
#include <cucumber-cpp/autodetect.hpp>
43+
GIVEN("a step") {
44+
<check>(false, "boost message");
45+
}
46+
"""
47+
When Cucumber runs the feature
48+
Then the scenario <passes or fails?>
49+
50+
Examples:
51+
| check | passes or fails? |
52+
| BOOST_WARN_MESSAGE | passes |
53+
| BOOST_CHECK_MESSAGE | fails with message "boost message" |
54+
| BOOST_REQUIRE_MESSAGE | fails with message "boost message" |
55+
56+
57+
Scenario Outline: <check> macro
58+
Given the following feature:
59+
"""
60+
Feature: Feature name
61+
Scenario: Scenario name
62+
Given a step
63+
"""
64+
And a step definition file with:
65+
"""
66+
#include <boost/test/unit_test.hpp>
67+
#include <cucumber-cpp/autodetect.hpp>
68+
GIVEN("a step") {
69+
<check>("boost message");
70+
}
71+
"""
72+
When Cucumber runs the feature
73+
Then the scenario <passes or fails?>
74+
75+
Examples:
76+
| check | passes or fails? |
77+
| BOOST_ERROR | fails with message "boost message" |
78+
| BOOST_FAIL | fails with message "boost message" |
79+

features/specific/predicate_message.feature

-72
This file was deleted.

features/step_definitions/cucumber_cpp_steps.rb

+6
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@
1313
Then /^a step definition snippet with (".*") is suggested$/ do |regex_string|
1414
assert_partial_output("(#{regex_string}) {", all_output)
1515
end
16+
17+
Then /^the scenario fails with message "([^"]*)"$/ do |message|
18+
assert_partial_output(message, all_output)
19+
assert_success false
20+
end
21+

0 commit comments

Comments
 (0)