2014-07-08 28 views
1

每当我尝试运行我的rspec测试(使用'rspec spec'或'bundle exec rspec spec')时,屏幕上会显示大量输出。它似乎正在经历我的Gemfile中的每一个宝石,并显示它的消息。以下是该输出的一个例子(还有更多)。RSpec加载所有gem文件

有人可以告诉我这些消息是什么,以及如何阻止他们显示每次我想运行测试?

C:/Ruby193/lib/ruby/gems/1.9.1/gems/mail-2.5.4/lib/mail/network/delivery_methods 
/sendmail.rb:53: warning: shadowing outer local variable - to 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-rails-3.0.1/lib/rspec/rails/matchers/h 
ave_http_status.rb:87: warning: assigned but unused variable - _ignored 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-rails-3.0.1/lib/rspec/rails/matchers/h 
ave_http_status.rb:142: warning: assigned but unused variable - _ignored 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-rails-3.0.1/lib/rspec/rails/matchers/h 
ave_http_status.rb:257: warning: assigned but unused variable - _ignored 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/holidays-1.0.6/lib/holidays.rb:361: warning: 
assigned but unused variable - e 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/business_time-0.7.3/lib/business_time/config 
.rb:76: warning: method redefined; discarding old end_of_workday 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/business_time-0.7.3/lib/business_time/config 
.rb:31: warning: previous definition of end_of_workday was here 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/business_time-0.7.3/lib/business_time/config 
.rb:85: warning: method redefined; discarding old beginning_of_workday 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/business_time-0.7.3/lib/business_time/config 
.rb:31: warning: previous definition of beginning_of_workday was here 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/business_time-0.7.3/lib/business_time/config 
.rb:94: warning: method redefined; discarding old work_week= 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/business_time-0.7.3/lib/business_time/config 
.rb:34: warning: previous definition of work_week= was here 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-4.1.1/lib/active_support/depen 
dencies.rb:247: warning: loading in progress, circular require considered harmfu 
l - C:/Ruby193/lib/ruby/gems/1.9.1/gems/haml-4.0.5/lib/haml/template.rb 
     from C:/Ruby193/bin/rspec:23:in `<main>' 
     from C:/Ruby193/bin/rspec:23:in `load' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-3.0.2/exe/rspec:4:in 
`<top (required)>' 

回答

4

参见https://github.com/rspec/rspec-core/issues/1571。基本上,最近的rspec版本默认将--warnings添加到.rspec文件。这导致了很多关于gems输出代码的警告。现在的'修复'是删除--warnings行。

+0

谢谢!所有这些警告真的吓坏了我。 – hlee

相关问题