|
16 | 16 |
|
17 | 17 | namespace cucumber_cpp::library::engine |
18 | 18 | { |
19 | | - ScenarioInfo::ScenarioInfo(const struct RuleInfo& ruleInfo, std::set<std::string, std::less<>> tags, std::string title, std::string description, std::size_t line, std::size_t column) |
20 | | - : parentInfo{ &ruleInfo } |
| 19 | + ScenarioInfo::ScenarioInfo(cucumber::messages::pickle pickle, const struct RuleInfo& ruleInfo, std::set<std::string, std::less<>> tags, std::string description, std::size_t line, std::size_t column) |
| 20 | + : pickle(std::move(pickle)) |
| 21 | + , parentInfo{ &ruleInfo } |
21 | 22 | , tags{ std::move(tags) } |
22 | | - , title{ std::move(title) } |
23 | 23 | , description{ std::move(description) } |
24 | 24 | , line{ line } |
25 | 25 | , column{ column } |
26 | 26 | {} |
27 | 27 |
|
28 | | - ScenarioInfo::ScenarioInfo(const struct FeatureInfo& featureInfo, std::set<std::string, std::less<>> tags, std::string title, std::string description, std::size_t line, std::size_t column) |
29 | | - : parentInfo{ &featureInfo } |
| 28 | + ScenarioInfo::ScenarioInfo(cucumber::messages::pickle pickle, const struct FeatureInfo& featureInfo, std::set<std::string, std::less<>> tags, std::string description, std::size_t line, std::size_t column) |
| 29 | + : pickle(std::move(pickle)) |
| 30 | + , parentInfo{ &featureInfo } |
30 | 31 | , tags{ std::move(tags) } |
31 | | - , title{ std::move(title) } |
32 | 32 | , description{ std::move(description) } |
33 | 33 | , line{ line } |
34 | 34 | , column{ column } |
@@ -61,7 +61,7 @@ namespace cucumber_cpp::library::engine |
61 | 61 |
|
62 | 62 | const std::string& ScenarioInfo::Title() const |
63 | 63 | { |
64 | | - return title; |
| 64 | + return pickle.name; |
65 | 65 | } |
66 | 66 |
|
67 | 67 | const std::string& ScenarioInfo::Description() const |
@@ -93,4 +93,10 @@ namespace cucumber_cpp::library::engine |
93 | 93 | { |
94 | 94 | return children; |
95 | 95 | } |
| 96 | + |
| 97 | + std::string ScenarioInfo::ToJson() const |
| 98 | + { |
| 99 | + return pickle.to_json(); |
| 100 | + } |
| 101 | + |
96 | 102 | } |
0 commit comments