O'Reilly logo

Scala Test-Driven Development by Gaurav Sood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

There are some obvious issues that we can see in this implementation. Firstly, there is lot of common code that can be reused. Secondly, the require clause in the Number trait is not quite fit for purpose now, as effectively we can create Binary("ABC") without any exceptions. It would be a good idea to tinker around with the code at this point and try and experiment with the Matchers we have discussed in this chapter.

In the coming chapters, we will look to evolve a fixture. We will also evolve the architecture of our application code gradually with more features being added.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required