Add test for AND_GIVEN and update the baselines

This commit is contained in:
Martin Hořeňovský 2018-09-02 15:38:33 +02:00
parent 64fd5b8058
commit efbf50fc7d
4 changed files with 58 additions and 50 deletions

View File

@ -6349,6 +6349,7 @@ with expansion:
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Scenario: Do that thing with the thing Scenario: Do that thing with the thing
Given: This stuff exists Given: This stuff exists
And given: And some assumption
When: I do this When: I do this
Then: it should do this Then: it should do this
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -6364,6 +6365,7 @@ with expansion:
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Scenario: Do that thing with the thing Scenario: Do that thing with the thing
Given: This stuff exists Given: This stuff exists
And given: And some assumption
When: I do this When: I do this
Then: it should do this Then: it should do this
And: do that And: do that

View File

@ -522,8 +522,8 @@ Matchers.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="SUCCEED does not require an argument" time="{duration}"/> <testcase classname="<exe-name>.global" name="SUCCEED does not require an argument" time="{duration}"/>
<testcase classname="<exe-name>.Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me" time="{duration}"/> <testcase classname="<exe-name>.Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me" time="{duration}"/>
<testcase classname="<exe-name>.Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me/When: We get the count/Then: Subsequently values are higher" time="{duration}"/> <testcase classname="<exe-name>.Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me/When: We get the count/Then: Subsequently values are higher" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Scenario: Do that thing with the thing/Given: This stuff exists/When: I do this/Then: it should do this" time="{duration}"/> <testcase classname="<exe-name>.global" name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption/When: I do this/Then: it should do this" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Scenario: Do that thing with the thing/Given: This stuff exists/When: I do this/Then: it should do this/And: do that" time="{duration}"/> <testcase classname="<exe-name>.global" name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption/When: I do this/Then: it should do this/And: do that" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Scenario: This is a really long scenario name to see how the list command deals with wrapping/Given: A section name that is so long that it cannot fit in a single console width/When: The test headers are printed as part of the normal running of the scenario/Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" time="{duration}"/> <testcase classname="<exe-name>.global" name="Scenario: This is a really long scenario name to see how the list command deals with wrapping/Given: A section name that is so long that it cannot fit in a single console width/When: The test headers are printed as part of the normal running of the scenario/Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector" time="{duration}"/> <testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector/When: it is made larger/Then: the size and capacity go up" time="{duration}"/> <testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector/When: it is made larger/Then: the size and capacity go up" time="{duration}"/>

View File

@ -6644,6 +6644,7 @@
</TestCase> </TestCase>
<TestCase name="Scenario: Do that thing with the thing" tags="[Tags]" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" > <TestCase name="Scenario: Do that thing with the thing" tags="[Tags]" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
<Section name="Given: This stuff exists" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" > <Section name="Given: This stuff exists" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
<Section name="And given: And some assumption" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
<Section name="When: I do this" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" > <Section name="When: I do this" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
<Section name="Then: it should do this" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" > <Section name="Then: it should do this" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
@ -6671,6 +6672,8 @@
</Section> </Section>
<OverallResults successes="2" failures="0" expectedFailures="0"/> <OverallResults successes="2" failures="0" expectedFailures="0"/>
</Section> </Section>
<OverallResults successes="2" failures="0" expectedFailures="0"/>
</Section>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
<TestCase name="Scenario: This is a really long scenario name to see how the list command deals with wrapping" tags="[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter][long][lots][one very long tag name that should cause line wrapping writing out using the list command][tags][verbose][very long tags]" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" > <TestCase name="Scenario: This is a really long scenario name to see how the list command deals with wrapping" tags="[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter][long][lots][one very long tag name that should cause line wrapping writing out using the list command][tags][verbose][very long tags]" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >

View File

@ -38,6 +38,8 @@ namespace { namespace BDDTests {
SCENARIO("Do that thing with the thing", "[Tags]") { SCENARIO("Do that thing with the thing", "[Tags]") {
GIVEN("This stuff exists") { GIVEN("This stuff exists") {
// make stuff exist // make stuff exist
AND_GIVEN("And some assumption") {
// Validate assumption
WHEN("I do this") { WHEN("I do this") {
// do this // do this
THEN("it should do this") { THEN("it should do this") {
@ -47,6 +49,7 @@ namespace { namespace BDDTests {
} }
} }
} }
}
SCENARIO("Vector resizing affects size and capacity", "[vector][bdd][size][capacity]") { SCENARIO("Vector resizing affects size and capacity", "[vector][bdd][size][capacity]") {
GIVEN("an empty vector") { GIVEN("an empty vector") {