If turn_twizzles
, push_buttons
, and move_mountain
are public and called by other code, then I think it's important to refactor your tests to test these functions individually.
Unfortunately after your refactor you have a problem: to unit test do_everything
you need to be able to mock turn_twizzles
, push_buttons
, and move_mountain
. Writing tests for do_everything
without mocking the dependencies will be an integration test--not necessarily a bad thing depending on your test plan, but there won't be much benefit because you're already testing the three smaller functions individually. This may be the right time for you to redesign this component and collaborate with other objects to do all the work of do_everything
.
If turn_twizzles
, push_buttons
, and move_mountain
are not called externally, they should be marked private, and I wouldn't recommend testing them separately from do_everything
. This is because from an outside-looking-in perspective, do_everything
would be the smallest unit (because the others are inaccessible). Also see this answer about breaking up methods using private methods.