Exercising Options

For the next feature, I started supporting options. Perhaps the most useful option writes the retrieved content to a file, although you could always redirect the output without it. I started work on the “-O” option by updating the specification to detail curl’s behavior in [bb7347e].

The path to support this option meanders a bit. Admittedly, I did not start with a complete or clean concept of how the feature would be implemented. Rather, I started with an idea of how the arguments might be processed but only a clear understanding that the output handling might be tricky to test properly. I decided to show the messiness and the associated variations of testing rather than doing exploratory spikes and then reverting them to ...

Get Quality Code: Software Testing Principles, Practices, and Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.