From 6bfe7ce7843869e5f17329c2eaee5ced8fb49d36 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Fri, 28 Feb 2014 09:13:09 -0500 Subject: [PATCH] capture user's expectations as system tests so that we can fix them soon --- .../test_interactions/ignore_args_only.yml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/test/system/test_interactions/ignore_args_only.yml b/test/system/test_interactions/ignore_args_only.yml index f3286bd..286b7c8 100644 --- a/test/system/test_interactions/ignore_args_only.yml +++ b/test/system/test_interactions/ignore_args_only.yml @@ -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: |