DEV Community

Discussion on: Top 5 Best Testing Ruby Gems For Building Ruby on Rails Web Application

jdickey profile image
Jeff Dickey

This was an interesting list; I would have said "a great list for circa 2010 Rails development". Most of these are still around, but the projects I've seen and/or worked on in the last few years that had previously used them have largely either already left or are evaluating what it would take to do so. This isn't meant to be a diag against you, reall, especially if the projects you've been working on are older code.. For example:

  1. factory_girl isn't even factory_girl anymore, as your link shows; it's factory_bot instead. It's had it's ups and downs, but if you still prefer its style of doing things after looking at alternatives (there's a lot to like in fabrication, among others), go for it. There is no One Right Tool for every team, but a team that blindly follows earlier practice is guilty of cargo culting.
  2. Does anybody use shoulda-matchers on greenfield projects in 2020? We left it because it didn't seem to fit in well with recent consensus on best practices, like RSpec/Minitest::Spec descriptive ("narrative") specs. If you're still using TestUnit or Minitest::Unit then, again, go for it; that style of procedural specification of tests appears to be Shoulda's sweet spot. The rest of us get the feeling that we shoulda used something else.
  3. Simplecov is great at what it does, but know its limitations. It provides line coverage, not statement or branch coveragee. Other languages have had higher-order coverage tools for decades now, and I understand that they're rare in the dynamic-language world, but there is a crying need — which is not mitigated by people having no clue what they're missing.

Just my thoughts after using most of these. I'm guessing that you may be working with older codebases, or that you're relatively new to Ruby. In either case, I apologise for sounding a bit harsh; in the second, welcome to RUby! Many of us have learned the hard way that writing about what we love is a great way to improve our knowledge...even if that means having to put up with the occasional Old Phart who grumps all over your writing. Do please continue!

emilyjo84160559 profile image
Emily Johnson Author

Yes Not all applications are up-to-date with the recent codebase so we have to use still some old gems. Either in any case depending upon requirement and version one can use these gems. :)