| 35 | } |
| 36 | |
| 37 | const std::string CukeCommands::snippetText( |
| 38 | const std::string stepKeyword, const std::string stepName |
| 39 | ) const { |
| 40 | std::stringstream text; |
| 41 | std::string stepKeywordUpperCase; |
| 42 | std::transform( |
| 43 | stepKeyword.begin(), stepKeyword.end(), std::back_inserter(stepKeywordUpperCase), ::toupper |
| 44 | ); |
| 45 | text << stepKeywordUpperCase << "(\"" << escapeCString("^" + escapeRegex(stepName) + "$") |
| 46 | << "\") {\n" |
| 47 | << " pending();\n" |
| 48 | << "}\n"; |
| 49 | return text.str(); |
| 50 | } |
| 51 | |
| 52 | const std::string CukeCommands::escapeRegex(const std::string reg) const { |
| 53 | return regex_replace( |