Subject: | Check order of invoked expectations |
Would be great to have ability to check order in which expectations are invoked.
example of hack to emulate this
hack code:
https://github.com/vsespb/mt-aws-glacier/blob/d4b6d30b76272f749306605361a6e5add5a0c10f/t/TestUtils.pm#L113
Example of tests
https://github.com/vsespb/mt-aws-glacier/blob/d4b6d30b76272f749306605361a6e5add5a0c10f/t/unit/cmd_sync.t#L53
so I have a method Test::Spec::Mocks::Expectation::returns_ordered which acts similar to Test::Spec::Mocks::Expectation::returns but checks that invocations were in same order as declared inspectations.
obviously works only with 'once'
Typical usage:
if you have
$obj->destroy_database()
...
$obj->write_database()
it's very important to check in which order it's called.