Posted over 11 years ago. Visible to the public. Linked content.

Silencing Deprecation Warnings in Rspec

If you’re testing the behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec output is incredibly noisy.

You could silence all warnings with ::ActiveSupport::Deprecation.silenced = true, but you might miss out on an important warning in one of your dependencies. It’s tempting to remove the tests altogether (the code will be burned soon too, right?), but I figured out something a little nicer a little while back in Formtastic’s test suite.

Your development team has a full backlog of feature requests, chores and refactoring coupled with deadlines? We are familiar with that. With our "DevOps as a Service" offering, we support developer teams with infrastructure and operations expertise.

Owner of this card:

Avatar
Lexy
Last edit:
over 11 years ago
Keywords:
makandra, rspec, ruby, testing, rails
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Lexy to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more