Re: [PATCH v6] format-patch --signature-file <file>
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 21, 2014, 22:48 UTC
- Message-ID
- <xmqq7g5eoiia.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20140521222701.GA24537@hudson.localdomain>
Jeremiah Mahler <jmmahler@gmail.com> writes:
Show 16 quoted lines
> On Wed, May 21, 2014 at 03:15:55PM -0700, Junio C Hamano wrote: >> Jeff King <peff@peff.net> writes: >> >> Yeah, placing it in its own setup may be the best. There are quite >> a many set-ups outside the tests in this script from the olden days, >> so I am OK if left it as-is and have a separate clean-up patch after >> this topic settles. I am also OK to add a new one "the new right way" >> so that a later clean-up patch does not have to change what is added >> in this step. > > I like the idea of limiting the scope of this data so it couldn't > inadvertently impact later tests. > > But placing the same data inside multiple test cases creates duplication. > > Is there a way to define data once for a limited set of tests?
That is what Jeff ment by "used across many tests. ... it could go in its own setup".
In other words,
test_expect_success 'prepare mail-signature input' '
cat >mail-signature <<-\EOF
...
EOF
' test_expect_success 'one test that uses mail-signature' '
use mail-signature &&
test the output
' test_expect_success 'another test that uses mail-signature' '
use mail-signature in a different way &&
test the output
'