Rspec NoMethodError
Rspec NoMethodError
我下载了 rspec 和捆绑器。我遵循非常具体的指示,但我不断收到这些错误消息。它说它应该 运行.
我有 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.
我下载了 rspec 和捆绑器。我遵循非常具体的指示,但我不断收到这些错误消息。它说它应该 运行.
我有 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.