grackkle
grackkle

Reputation: 796

Exclude gem warnings in rake tests without removing warnings from own code

In our current Ruby (ruby 2.4.2p131, installed by rbenv as 2.4.0-dev) (NOT Rails) project we use a number of gems that produce warnings. I appreciate warnings that are caused by our own code and want to see and remove them, but there is not much to be done about warnings from gems. Is there a way to show only our own warnings?

I searched for similar questions, but they either require Rails, or want to disable ALL warnings. Both doesn't meet our requirements.

I also tried the warning gem (https://rubygems.org/gems/warning/versions/0.10.0) but failed to produce any change with it.

EDIT Here is two of the warnings that I don't want to see:
aws-sdk-resources-2.9.8/lib/aws-sdk-resources/services/s3/object.rb:61: warning: method redefined; discarding old copy_from

aws-sdk-core-2.9.8/lib/aws-sdk-core/plugins/s3_accelerate.rb:75: warning: assigned but unused variable - ssl

Upvotes: 3

Views: 1396

Answers (2)

Jonathan Swartz
Jonathan Swartz

Reputation: 1983

See https://github.com/jeremyevans/ruby-warning/, which lets you ignore specific warnings by type and the file where they occurred (e.g. only in gems).

Upvotes: 0

AadityaTaparia
AadityaTaparia

Reputation: 31

Add $verbose = nil at the start of your test_helper file

Upvotes: -1

Related Questions