我下载了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'
答案 0 :(得分:3)
您尝试在spec_helper.rb
文件(include_chain_clauses_in_custom_matcher_descriptions
)中设置的配置选项是在每个https://github.com/rspec/rspec-expectations/blob/v3.1.0/Changelog.md的RSpec 3.1中引入的,但您运行的是RSpec 2.99。