相关信息
在运行“警卫”时,我看到cli选项已被废弃。阅读后续程序cmd,并将其实现如下:
# Before
guard :rspec, after_all_pass: false, cli: '--drb' do
...
end
# After
guard :rspec, after_all_pass: false, cmd: 'bundle exec rspec --drb' do
...
end在启动了这些更改之后,除了Capybara支持的测试(功能)之外,所有测试都失败了。在终端中直接运行bundle exec控制台将导致所有测试通过。返回到使用cli结果的所有测试通过。
有什么想法吗?
编辑
下面是我在使用cmd: 'rspec --drb'时所看到的测试输出。
00:21:38 - INFO - Running: spec/features/devise/confirmations_spec.rb
Running tests with args ["--color", "--failure-exit-code", "2", "--format", "documentation", "--format", "html", "--out", "reports/rspec_results.html", "--format", "Guard::RSpec::Formatter", "--require", "spec_helper", "--require", "/Users/viet/.rvm/gems/ruby-2.1.0/gems/guard-rspec-4.2.6/lib/guard/rspec/formatter.rb", "spec/features/devise/confirmations_spec.rb"]...
Confirmations
#new
should accept incorrect email and not send reset email (FAILED - 1)
should accept correct email and send instructions email (FAILED - 2)
should accept incorrect username and not send reset email (FAILED - 3)
should accept correct username and send instructions email (FAILED - 4)
Failures:
1) Confirmations #new should accept incorrect email and not send reset email
Failure/Error: within('#new_user') { fill_in 'user_login', with: 'wrong@foobar.com' }
Capybara::ElementNotFound:
Unable to find css "#new_user"
# ./spec/features/devise/confirmations_spec.rb:40:in `block (3 levels) in <top (required)>'
2) Confirmations #new should accept correct email and send instructions email
Failure/Error: within('#new_user') { fill_in 'user_login', with: user.email }
Capybara::ElementNotFound:
Unable to find css "#new_user"
# ./spec/features/devise/confirmations_spec.rb:23:in `block (3 levels) in <top (required)>'
3) Confirmations #new should accept incorrect username and not send reset email
Failure/Error: within('#new_user') { fill_in 'user_login', with: 'foobar' }
Capybara::ElementNotFound:
Unable to find css "#new_user"
# ./spec/features/devise/confirmations_spec.rb:32:in `block (3 levels) in <top (required)>'
4) Confirmations #new should accept correct username and send instructions email
Failure/Error: within('#new_user') { fill_in 'user_login', with: user.name }
Capybara::ElementNotFound:
Unable to find css "#new_user"
# ./spec/features/devise/confirmations_spec.rb:14:in `block (3 levels) in <top (required)>'
Finished in 2.34 seconds
4 examples, 4 failures
Failed examples:
rspec ./spec/features/devise/confirmations_spec.rb:39 # Confirmations #new should accept incorrect email and not send reset email
rspec ./spec/features/devise/confirmations_spec.rb:22 # Confirmations #new should accept correct email and send instructions email
rspec ./spec/features/devise/confirmations_spec.rb:31 # Confirmations #new should accept incorrect username and not send reset email
rspec ./spec/features/devise/confirmations_spec.rb:13 # Confirmations #new should accept correct username and send instructions email
Randomized with seed 29280
Done.返回到cli: '--drb',测试按预期通过。
发布于 2014-03-05 22:00:33
看上去像DRb支持已被移除,自保卫-rspec 4.0以来。你可以留在警卫-rspec 3.1.0,或(更好)切换到宙斯或春天!
https://stackoverflow.com/questions/21922859
复制相似问题