File tree Expand file tree Collapse file tree 4 files changed +8
-11
lines changed Expand file tree Collapse file tree 4 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 136136 ``` cpp
137137 #include < Gunit.h>
138138
139- GSTEPS ("Calc* ") { // Calc Addition
139+ GSTEPS ("Calc* ") { // " Calc Addition.Add two numbers"
140140 double result{};
141141
142142 Given("I created a calculator with value {n}") =
Original file line number Diff line number Diff line change 1414* Synopsis
1515 ``` cpp
1616 /* *
17- * @param feature regex expression matching a feature name
18- * example: "Calc*"
17+ * @param feature.scenario regex expression matching a feature name
18+ * example: "Calc*" - all scenarios from Calc feature
19+ * example: "Calc Addition.Add two numbers" - Only 'Add two numbers' scenario from Calc feature
1920 */
20- #define GSTEPS (feature ) // register steps for a feature
21+ #define GSTEPS (name ) // register steps for a feature.scenario
2122
2223 namespace testing {
2324 /**
Original file line number Diff line number Diff line change @@ -378,8 +378,9 @@ class Steps {
378378 const std::string scenario_name = pickle_json[" name" ];
379379 const auto tags = detail::make_tags (pickle_json[" tags" ]);
380380 const auto disabled = tags.first ? " DISABLED_" : " " ;
381+ const auto full_name = feature_name + " ." + scenario_name;
381382
382- if (PatternMatchesString (name.c_str (), feature_name .c_str ())) {
383+ if (PatternMatchesString (name.c_str (), full_name .c_str ())) {
383384 info_.feature = feature_name;
384385
385386 detail::MakeAndRegisterTestInfo (
Original file line number Diff line number Diff line change 1212#include " Features/Calc/Impl/Calculator.h"
1313
1414// clang-format off
15- GSTEPS (" Calc" ) {
15+ GSTEPS (" Calc Addition.Add two numbers " ) {
1616 using namespace testing ;
1717 Calculator calc{};
1818 double result{};
@@ -30,11 +30,6 @@ GSTEPS("Calc") {
3030 result = calc.add ();
3131 };
3232
33- When (" I press divide" _step) =
34- [&] {
35- result = calc.divide ();
36- };
37-
3833 Then (" the result should be {expected} on the screen" _step) =
3934 [&](double expected) {
4035 EXPECT_EQ (expected, result);
You can’t perform that action at this time.
0 commit comments