Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: AND_GIVEN #1360

Closed
parnmatt opened this issue Aug 12, 2018 · 0 comments
Closed

Feature Request: AND_GIVEN #1360

parnmatt opened this issue Aug 12, 2018 · 0 comments

Comments

@parnmatt
Copy link
Contributor

To be consistent with the AND_WHEN and AND_THEN;

With BDD:

there are times when you require to expand the context, if you feel a need to type 'and' in the context of a GIVEN, WHEN, and/or THEN, you should use AND.

we don't have an AND, because that just doesn't work in this abstraction; thus we have AND_WHEN and AND_THEN; thus we should also have AND_GIVEN.

horenmar pushed a commit that referenced this issue Sep 2, 2018
issue #1360

It is possible to have multple  given contexts in a single BDD scenario;
if you have to type 'and' in the GIVEN description; it's very likely you
need an AND.

A generic AND  is not possible, thus a AND_GIVEN  is added to complement
the AND_WHEN and AND_THEN.

Can be used without needing to increase indent:

	SCENARIO("...") {
		GIVEN("...")
		AND_GIVEN("...") {
			WHEN("...") {
				THEN("...") {
					// ...
				}
			}
		}
	}

would correctly output, when requested/needed:

    Given: ...
And given: ...
     When: ...
     Then: ...

The padding had to be increased by a character in the output message, to
continue to be uniform.
claremacrae added a commit to claremacrae/Catch2 that referenced this issue Jul 22, 2019
horenmar pushed a commit to claremacrae/Catch2 that referenced this issue Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants