capture user's expectations as system tests so that we can fix them soon

This commit is contained in:
Mark VanderVoord
2014-02-28 09:13:09 -05:00
parent cf9961f81e
commit 6bfe7ce784
@@ -86,6 +86,55 @@
TEST_ASSERT_EQUAL(150, function(0, 0, 0));
}
- :pass: TRUE
:should: 'be able to handle an expect after ignore calls since we are ignoring args only'
:code: |
test()
{
bar_Ignore();
foo_IgnoreAndReturn(50);
foo_IgnoreAndReturn(50);
foo_ExpectAndReturn(3, 50);
TEST_ASSERT_EQUAL(150, function(1, 2, 3));
}
- :pass: TRUE
:should: 'be able to handle an ignore after an expect call since we are ignoring args only'
:code: |
test()
{
bar_Ignore();
foo_ExpectAndReturn(1, 50);
foo_IgnoreAndReturn(50);
foo_IgnoreAndReturn(50);
TEST_ASSERT_EQUAL(150, function(1, 2, 3));
}
- :pass: TRUE
:should: 'be able to handle an ignore within expect calls since we are ignoring args only'
:code: |
test()
{
bar_Ignore();
foo_ExpectAndReturn(1, 50);
foo_IgnoreAndReturn(50);
foo_ExpectAndReturn(3, 50);
TEST_ASSERT_EQUAL(150, function(1, 2, 3));
}
# TODO: THIS IS WHAT PEOPLE EXPECT, BUT IS NOT BEING MET YET.
- :pass: FALSE
:should: 'be able to detect problems with an expect even when using ignores'
:code: |
test()
{
bar_Ignore();
foo_ExpectAndReturn(1, 50);
foo_IgnoreAndReturn(50);
foo_ExpectAndReturn(4, 50);
TEST_ASSERT_EQUAL(150, function(1, 2, 3));
}
- :pass: TRUE
:should: 'ignore foo() calls over multiple mock calls'
:code: |