mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-17 20:55:38 +02:00
Added StringMaker (for partially specialising string conversions), extended BDD macros and moved file/line info to top of message.
Re-enable ANSI colour by default - hopefully properly excluding Windows this time
This commit is contained in:
@@ -14,11 +14,14 @@
|
||||
|
||||
// !TBD: story scenarios map to class based tests
|
||||
#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags )
|
||||
#define GIVEN( desc ) SECTION( " Given: " desc, "" )
|
||||
#define WHEN( desc ) SECTION( " When: " desc, "" )
|
||||
#define THEN( desc ) SECTION( " Then: " desc, "" )
|
||||
#define GIVEN( desc ) SECTION( "Given: " desc, "" )
|
||||
#define WHEN( desc ) SECTION( " When: " desc, "" )
|
||||
#define AND_WHEN( desc ) SECTION( " And: " desc, "" )
|
||||
#define THEN( desc ) SECTION( " Then: " desc, "" )
|
||||
#define AND_THEN( desc ) SECTION( " And: " desc, "" )
|
||||
|
||||
inline bool itDoesThis(){ return true; }
|
||||
inline bool itDoesThat(){ return true; }
|
||||
|
||||
SCENARIO( "Do that thing with the thing", "[tags]" ) {
|
||||
GIVEN( "This stuff exists" ) {
|
||||
@@ -26,7 +29,11 @@ SCENARIO( "Do that thing with the thing", "[tags]" ) {
|
||||
WHEN( "I do this" ) {
|
||||
// do this
|
||||
THEN( "it should do this")
|
||||
{
|
||||
REQUIRE( itDoesThis() );
|
||||
AND_THEN( "do that")
|
||||
REQUIRE( itDoesThat() );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user