I'm working on my first real-world Rails project. So far, I'm mostly mashing up functionality from 3rd-party libraries. There's a lot of great ones out there, and that's great.
I'm wondering about whether writing unit tests around these libraries is necessary/useful or not. For example, I just integrated friendly_id around one of my models. Besides installing the gem and adding it as a project dependency, this extent of this integration amounted to:
has_friendly_id :name
It Just Worked, and I barely consider this to be "code I wrote". So what should I be writing by way of tests?
There's two caveats to my question:
- I'm assuming that all of my 3rd-party libraries have appropriate tests of their own -- and so writing new unit tests directly against those libraries looks like repeating code. (If I had to use a poorly-tested library then I'd be less hesitant to write tests for it.)
- Under Defect-Driven-Testing, I'd definitely write a test the second I encounter a problem. If the test uncovered a bug in the library, then I'd probably submit the test to the maintainer.
Outside of that though... is there much point to testing 3rd-party code?