2014-07-08 66 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

相關問題