Chapter 11: Testing to Ensure Your Code Works
Testing is more critical in Ruby than in most other programming environments, partly because of the power and flexibility Ruby offers, and also because of Ruby's dynamic typing. With proper testing, you can have confidence that your code works the way you expect, which is critical whenever you are making changes to it.
In this chapter, you'll learn that there are a lot of important considerations when testing, such as at what levels you want to test, how much abstraction should be used in your tests, and how thorough your tests need to be.
We will cover the following topics in this chapter:
- Understanding why testing is so critical in Ruby
- Learning different approaches to testing
- Considering test complexity
- Understanding the many levels of testing
- Realizing that 100% coverage means nothing
By the end of this chapter, you'll have a better understanding of testing in Ruby, and be better able...