gpt4 book ai didi

ruby - Rspec 没有方法错误

转载 作者:数据小太阳 更新时间:2023-10-29 08:37:19 24 4
gpt4 key购买 nike

我下载了 rspec 和 bundler。我遵循非常具体的指示,但我不断收到这些错误消息。它说它应该运行。

我有 rspec-core 的 2.99 版和 3.2 版。我已将 2.99 版本放入此 rspec 文件中,但它似乎没有帮助。

Qureshis-MacBook-Pro:test-first-ruby-master Qureshi$ bundle exec rspec spec/00_hello_spec.rb
/Users/Qureshi/Desktop/test-first-ruby-master/spec/spec_helper.rb:31:in `block (2 levels) in <top (required)>': undefined method `include_chain_clauses_in_custom_matcher_descriptions=' for #<RSpec::Expectations::Configuration:0x007fcf3289f4c8> (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:580:in `expect_with'
from /Users/Qureshi/Desktop/test-first-ruby-master/spec/spec_helper.rb:23:in `block in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core.rb:154:in `configure'
from /Users/Qureshi/Desktop/test-first-ruby-master/spec/spec_helper.rb:19:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `require'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `block in setup_load_path_and_require'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `each'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `setup_load_path_and_require'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration_options.rb:25:in `configure'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/command_line.rb:17:in `run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/runner.rb:103:in `run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/runner.rb:17:in `block in autorun'

Qureshis-MacBook-Pro:test-first-ruby-master Qureshi$ bundle exec rspec spec
/Users/Qureshi/Desktop/test-first-ruby-master/spec/spec_helper.rb:31:in `block (2 levels) in <top (required)>': undefined method `include_chain_clauses_in_custom_matcher_descriptions=' for #<RSpec::Expectations::Configuration:0x007ff5c190f560> (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:580:in `expect_with'
from /Users/Qureshi/Desktop/test-first-ruby-master/spec/spec_helper.rb:23:in `block in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core.rb:154:in `configure'
from /Users/Qureshi/Desktop/test-first-ruby-master/spec/spec_helper.rb:19:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `require'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `block in setup_load_path_and_require'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `each'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `setup_load_path_and_require'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration_options.rb:25:in `configure'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/command_line.rb:17:in `run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/runner.rb:103:in `run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/runner.rb:17:in `block in autorun'

最佳答案

您尝试在 spec_helper.rb 文件 (include_chain_clauses_in_custom_matcher_descriptions) 中设置的配置选项已在 RSpec 3.1 per https://github.com/rspec/rspec-expectations/blob/v3.1.0/Changelog.md 中引入,但您运行的是 RSpec 2.99。

关于ruby - Rspec 没有方法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28663952/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com