不确定这是否是Capybara问题,但我刚刚安装了Rails(4.1.1)和Rspec Rails(3.0.1),我想使用Capybara(2.3.0),但从未使用过它,我遇到了问题。我在spec/features中创建了一个"spec",规范本身按照预期运行并通过,但是当rspec运行时,我得到以下"警告"。什么好主意吗?我只需要禁用警告在ruby级别或什么?
/Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/mail-2.5.4/lib/mail/network/delivery_methods/sendmail.rb:53: warning: shadowing outer local variable - to
/Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247: warning: loading in progress, circular require considered harmful - /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara.rb
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/bin/ruby_executable_hooks:15:in `<main>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/bin/ruby_executable_hooks:15:in `eval'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/bin/rspec:23:in `<main>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/bin/rspec:23:in `load'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/exe/rspec:4:in `<top (required)>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:38:in `invoke'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:70:in `run'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:85:in `run'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:97:in `setup'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in `load_spec_files'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in `each'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in `block in load_spec_files'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in `load'
from /Users/typeoneerror/Dev/Doki/engines/doki_core/spec/features/accounts/sign_up_spec.rb:1:in `<top (required)>'
from /Users/typeoneerror/Dev/Doki/engines/doki_core/spec/features/accounts/sign_up_spec.rb:1:in `require'
from /Users/typeoneerror/Dev/Doki/engines/doki_core/spec/rails_helper.rb:7:in `<top (required)>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-rails-3.0.1/lib/rspec/rails.rb:9:in `<top (required)>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/rspec-rails-3.0.1/lib/rspec/rails/vendor/capybara.rb:2:in `<top (required)>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara/rspec.rb:1:in `<top (required)>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara.rb:5:in `<top (required)>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara.rb:320:in `<module:Capybara>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara/dsl.rb:1:in `<top (required)>'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
/Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara/node/matchers.rb:121: warning: assigned but unused variable - e
/Users/typeoneerror/.rvm/gems/ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara/selenium/driver.rb:119: warning: assigned but unused variable - a
将--warnings
从.rspec
中移除。rspec 3.0.0中的生成器包含了这个设置,但我们已经意识到这是一个错误——虽然鼓励用户编写无警告的代码是件好事,但如果用户不确定为什么会得到这些警告,就会感到困惑。
查看更多信息:
https://github.com/rspec/rspec-core/issues/1571