Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Stop RSpec Warning Messages

I have just started learning to use RSpec on my rails application. It all seems to work ok, but when I run rspec spec I get pages and pages of what I think are lint messages.

I don't mind the ones that refer to my code, but lots of them refer to Gems that I am using. I can't really fix those.

How can I configure RSpec to apply lint only to my code and not external Gems?

Here is a small sample. I get over 2000 lines of this stuff.

/Users/jcreasey/.rvm/gems/ruby-2.0.0-p0/gems/sorcery-0.8.5/lib/sorcery/model.rb:265: warning: method redefined; discarding old username_attribute_names=
/Users/jcreasey/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251: warning: loading in progress, circular require considered harmful - /Users/jcreasey/.rvm/gems/ruby-2.0.0-p0/gems/sorcery-0.8.5/lib/sorcery.rb
    from /Users/jcreasey/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'
    from /Users/jcreasey/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/jcreasey/.rvm/gems/ruby-2.0.0-p0/bin/rspec:23:in `<main>'
    from /Users/jcreasey/.rvm/gems/ruby-2.0.0-p0/bin/rspec:23:in `load'
    from /Users/jcreasey/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-3.0.0/exe/rspec:4:in `<top (required)>'
    from /Users/jcreasey

This is my .rspec file

-color
--warnings
--require spec_helper
like image 617
John C Avatar asked Jun 08 '14 06:06

John C


1 Answers

If you have /.rspec file remove --warning option from it.

like image 140
zishe Avatar answered Oct 07 '22 01:10

zishe