Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Step 9: refactor ensureDemonstration to "pop"
In general, when I can remove a logical branch from a delegator unit (this unit is said to be a "delegator" because its primary task is offloading work onto other units), I'll usually rework the naming to push the branch down. Therefore, "ensureDemonstration" became "popDemonstration", and instead of simply providing a null-check and a potential error, it will now pop the CallLog itself and blow up as necessary. Does it really matter whose job that is? No, not really. But is the resulting `verify` module cleaner? Absolutely! It no longer mixes levels of abstraction quite so much (notice how before it was a little odd how the unit had awareness of a repository object as well as 5 business logic modules) This refactor is a good example of the kind of thought process that discovery testing encourages which I typically would never have undergone had I just written the code (or even "classical TDD'd" it)
- Loading branch information
Showing
4 changed files
with
9 additions
and
15 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export default function popDemonstration () { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters