From 839d348b6251ef34218920df9d24f9fb8e5f7afa Mon Sep 17 00:00:00 2001 From: Martin Moene Date: Wed, 22 Jul 2015 17:59:15 +0200 Subject: [PATCH] Allow non-literal string as description for BDD macros, issue #15 --- lest.hpp | 12 ++++++------ lest_cpp03.hpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lest.hpp b/lest.hpp index 9f60bf3..c098410 100644 --- a/lest.hpp +++ b/lest.hpp @@ -90,12 +90,12 @@ # define AND_THEN lest_AND_THEN #endif -#define lest_SCENARIO( sketch ) lest_CASE( "Scenario: " sketch ) -#define lest_GIVEN( context ) lest_SETUP( "Given: " context ) -#define lest_WHEN( story ) lest_SECTION( " When: " story ) -#define lest_THEN( story ) lest_SECTION( " Then: " story ) -#define lest_AND_WHEN( story ) lest_SECTION( " And: " story ) -#define lest_AND_THEN( story ) lest_SECTION( " And: " story ) +#define lest_SCENARIO( sketch ) lest_CASE( lest::text("Scenario: ") + sketch ) +#define lest_GIVEN( context ) lest_SETUP( lest::text( "Given: ") + context ) +#define lest_WHEN( story ) lest_SECTION( lest::text( " When: ") + story ) +#define lest_THEN( story ) lest_SECTION( lest::text( " Then: ") + story ) +#define lest_AND_WHEN( story ) lest_SECTION( lest::text( " And: ") + story ) +#define lest_AND_THEN( story ) lest_SECTION( lest::text( " And: ") + story ) #define lest_MODULE( specification, module ) \ namespace { lest::add_module _( specification, module ); } diff --git a/lest_cpp03.hpp b/lest_cpp03.hpp index 9ed2ea3..697e4ef 100644 --- a/lest_cpp03.hpp +++ b/lest_cpp03.hpp @@ -164,12 +164,12 @@ namespace lest # define AND_THEN lest_AND_THEN #endif -#define lest_SCENARIO( sketch ) lest_CASE( "Scenario: " sketch ) -#define lest_GIVEN( context ) lest_SETUP( "Given: " context ) -#define lest_WHEN( story ) lest_SECTION( " When: " story ) -#define lest_THEN( story ) lest_SECTION( " Then: " story ) -#define lest_AND_WHEN( story ) lest_SECTION( " And: " story ) -#define lest_AND_THEN( story ) lest_SECTION( " And: " story ) +#define lest_SCENARIO( sketch ) lest_CASE( lest::text("Scenario: ") + sketch ) +#define lest_GIVEN( context ) lest_SETUP( lest::text( "Given: ") + context ) +#define lest_WHEN( story ) lest_SECTION( lest::text( " When: ") + story ) +#define lest_THEN( story ) lest_SECTION( lest::text( " Then: ") + story ) +#define lest_AND_WHEN( story ) lest_SECTION( lest::text( " And: ") + story ) +#define lest_AND_THEN( story ) lest_SECTION( lest::text( " And: ") + story ) #define lest_TEST \ lest_CASE