Stubbing test for flatten()