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 136
136
``` cpp
137
137
#include < Gunit.h>
138
138
139
- GSTEPS ("Calc* ") { // Calc Addition
139
+ GSTEPS ("Calc* ") { // " Calc Addition.Add two numbers"
140
140
double result{};
141
141
142
142
Given("I created a calculator with value {n}") =
Original file line number Diff line number Diff line change 14
14
* Synopsis
15
15
``` cpp
16
16
/* *
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
19
20
*/
20
- #define GSTEPS (feature ) // register steps for a feature
21
+ #define GSTEPS (name ) // register steps for a feature.scenario
21
22
22
23
namespace testing {
23
24
/**
Original file line number Diff line number Diff line change @@ -378,8 +378,9 @@ class Steps {
378
378
const std::string scenario_name = pickle_json[" name" ];
379
379
const auto tags = detail::make_tags (pickle_json[" tags" ]);
380
380
const auto disabled = tags.first ? " DISABLED_" : " " ;
381
+ const auto full_name = feature_name + " ." + scenario_name;
381
382
382
- if (PatternMatchesString (name.c_str (), feature_name .c_str ())) {
383
+ if (PatternMatchesString (name.c_str (), full_name .c_str ())) {
383
384
info_.feature = feature_name;
384
385
385
386
detail::MakeAndRegisterTestInfo (
Original file line number Diff line number Diff line change 12
12
#include " Features/Calc/Impl/Calculator.h"
13
13
14
14
// clang-format off
15
- GSTEPS (" Calc" ) {
15
+ GSTEPS (" Calc Addition.Add two numbers " ) {
16
16
using namespace testing ;
17
17
Calculator calc{};
18
18
double result{};
@@ -30,11 +30,6 @@ GSTEPS("Calc") {
30
30
result = calc.add ();
31
31
};
32
32
33
- When (" I press divide" _step) =
34
- [&] {
35
- result = calc.divide ();
36
- };
37
-
38
33
Then (" the result should be {expected} on the screen" _step) =
39
34
[&](double expected) {
40
35
EXPECT_EQ (expected, result);
You can’t perform that action at this time.
0 commit comments