ruby - rspec-expectations-2.99.0/lib/rspec/matchers/built_in/raise_error.rb:5: uninitialized constant RSpec::Matchers::BuiltIn::RaiseError::MatchAliases -
output error running rspec in cookbook directory.
c:\users\a540409\ideaprojects\stores-v2\chef>bundle exec rspec c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.99.0/lib/rspec/matchers/built_in/raise_error.rb:5:in `<class:raiseerror>': uninitialized constant rspec::matchers::builtin::rais eerror::matchaliases (nameerror) c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.99.0/lib/rspec/matchers/built_in/raise_error.rb:4:in `<module:builtin>' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.99.0/lib/rspec/matchers/built_in/raise_error.rb:3:in `<module:matchers>' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.99.0/lib/rspec/matchers/built_in/raise_error.rb:2:in `<module:rspec>' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.99.0/lib/rspec/matchers/built_in/raise_error.rb:1:in `<top (required)>' c:/ruby193/lib/ruby/gems/1.9.1/gems/chefspec-3.4.0/lib/chefspec/expect_exception.rb:1:in `require' c:/ruby193/lib/ruby/gems/1.9.1/gems/chefspec-3.4.0/lib/chefspec/expect_exception.rb:1:in `<top (required)>' c:/ruby193/lib/ruby/gems/1.9.1/gems/chefspec-3.4.0/lib/chefspec.rb:26:in `require_relative' c:/ruby193/lib/ruby/gems/1.9.1/gems/chefspec-3.4.0/lib/chefspec.rb:26:in `<top (required)>' c:/users/a540409/ideaprojects/stores-v2/chef/spec/default_spec.rb:1:in `require' c:/users/a540409/ideaprojects/stores-v2/chef/spec/default_spec.rb:1:in `<top (required)>' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.0/lib/rspec/core/configuration.rb:1065:in `load' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.0/lib/rspec/core/configuration.rb:1065:in `block in load_spec_files' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.0/lib/rspec/core/configuration.rb:1065:in `each' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.0/lib/rspec/core/configuration.rb:1065:in `load_spec_files' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.0/lib/rspec/core/command_line.rb:18:in `run' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.0/lib/rspec/core/runner.rb:89:in `run' c:/ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.0/lib/rspec/core/runner.rb:17:in `block in autorun'
i tried using require 'rspec/expectations' based on this didn’t help. tried running using chefdk windows. same issue
here gem list. c:\users\a540409\ideaprojects\stores-v2\chef>gem list
*** local gems *** activesupport (3.2.18) addressable (2.3.6) akami (1.2.2) archive-tar-minitar (0.5.2) berkshelf (3.1.3, 3.0.1, 2.0.17) berkshelf-api-client (1.2.0) bigdecimal (1.1.0) buff-config (1.0.0, 0.4.0) buff-extensions (1.0.0, 0.5.0) buff-ignore (1.1.1) buff-ruby_engine (0.1.0) buff-shell_out (0.1.1) builder (3.2.2) bundler (1.6.3) celluloid (0.16.0.pre, 0.15.2) celluloid-io (0.16.0.pre, 0.15.0) chef (11.12.0 x86-mingw32, 11.6.0) chef-zero (2.2, 2.1.5, 2.0.2) chefspec (4.0.0, 3.4.0) chozo (0.6.1) coderay (1.1.0) columnize (0.8.9) dep-selector-libgecode (1.0.1) dep_selector (1.0.3) diff-lcs (1.2.5) em-winrm (0.5.5) erubis (2.7.0) eventmachine (1.0.3 x86-mingw32) excon (0.37.0) faraday (0.9.0, 0.8.9) fauxhai (2.1.2) ffi (1.9.3 x86-mingw32, 1.9.0 x86-mingw32, 1.5.0 x86-mingw32) fog (1.22.1) fog-brightbox (0.0.2) fog-core (1.22.0) fog-json (1.0.0) foodcritic (4.0.0) formatador (0.2.5) gherkin (2.12.2 x86-mingw32) gssapi (1.0.3) gyoku (1.1.1) hashie (3.0.0, 2.1.2) highline (1.6.21) hitimes (1.2.1) httpclient (2.4.0) httpi (0.9.7) i18n (0.6.9) io-console (0.3) ipaddress (0.8.0) json (1.8.1, 1.7.7, 1.5.5) kitchen-vagrant (0.15.0) knife-openstack (0.10.0) knife-windows (0.6.0) linecache19 (0.5.12) little-plugger (1.1.3) logging (1.8.2) method_source (0.8.2) mime-types (1.25.1) mini_portile (0.6.0) minitar (0.5.4) minitest (2.5.1) mixlib-authentication (1.3.0) mixlib-cli (1.5.0, 1.3.0) mixlib-config (2.1.0) mixlib-log (1.6.0) mixlib-shellout (1.4.0 x86-mingw32, 1.2.0 x86-mingw32) multi_json (1.10.1) multipart-post (2.0.0, 1.2.0) net-http-persistent (2.9.4) net-scp (1.2.1) net-ssh (2.9.1) net-ssh-gateway (1.2.0) net-ssh-multi (1.2.0, 1.1) nio4r (1.0.0) nokogiri (1.6.2.1 x86-mingw32) nori (1.1.5) octokit (3.1.2, 2.7.2) ohai (7.0.4) polyglot (0.3.5) pry (0.10.0 i386-mingw32) rack (1.5.2) rake (10.3.2, 0.9.2.2) rbzip2 (0.2.0) rdoc (3.9.5) rdp-ruby-wmi (0.3.1) rest-client (1.6.7) retryable (1.3.5) ridley (4.0.0, 3.1.0, 1.7.1) rspec (3.0.0, 2.99.0) rspec-core (3.0.2, 3.0.1, 2.99.0) rspec-expectations (3.0.2, 3.0.1, 2.99.0) rspec-its (1.0.1) rspec-mocks (3.0.2, 3.0.1, 2.99.1) rspec-support (3.0.2, 3.0.0, 3.0.0.rc1) ruby-debug-base19x (0.11.30.pre3) ruby-debug-ide (0.4.17) ruby-wmi (0.4.0) ruby_core_source (0.1.5) rubyntlm (0.1.1) rufus-lru (1.0.5) safe_yaml (1.0.3, 0.9.7) savon (0.9.5) sawyer (0.5.4) semverse (1.1.0) slop (3.5.0) solve (1.2.0, 0.8.2) systemu (2.5.2) test-kitchen (1.2.1, 1.1.0) thor (0.19.1, 0.18.1) timers (3.0.0, 2.0.0, 1.1.0) treetop (1.5.3) uuidtools (2.1.4) varia_model (0.4.0, 0.3.2) wasabi (1.0.0) win32-api (1.5.1 universal-mingw32, 1.4.8 x86-mingw32) win32-dir (0.4.5) win32-event (0.6.1) win32-ipc (0.6.1) win32-mmap (0.4.0) win32-mutex (0.4.1) win32-process (0.7.4, 0.7.3) win32-service (0.8.4, 0.8.2) win32console (1.3.2 x86-mingw32) windows-api (0.4.2) windows-pr (1.2.3, 1.2.2) winrm (1.1.3) yajl-ruby (1.2.1)
my spec_helper.rb:
require 'rspec/expectations' require 'chefspec' require 'chefspec/berkshelf' rspec.configure |config| config.platform = 'redhat' config.version = '6.3' #config.log_level = :debug end
my default_spec.rb:
require 'rspec/expectations' require 'chefspec' describe 'api-stores-v2::default' let (:chef_run) { chefspec::runner.new.converge 'api-stores-v2::default' } 'installs dependent packages' expect(chef_run).to include_recipe('java') end end
you have chefspec 4.0 installed, bundler picking older version. rspec 2.99 broken backwards-compatibility, need upgrade chefspec 4.0.
gem 'chefspec', '~> 4.0'
Comments
Post a Comment