diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-09-25 22:33:30 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-09-25 22:33:30 -0700 |
commit | 9fb62cda391591e0369ce32b8c8ec1afd3dfb8af (patch) | |
tree | ddfda448b6b63e88da8ed2e865a29311c18538bf /spec/unit/shell | |
parent | 671a1a740209a021fd31f451ec233bd884a5a37f (diff) | |
download | chef-9fb62cda391591e0369ce32b8c8ec1afd3dfb8af.tar.gz |
Work around rspec 3.8.0 issues
Problem is described in detail here:
https://github.com/rspec/rspec-expectations/issues/1068#issuecomment-424580564
Note that this is self-inflicted damage and our pattern of having #to_hash
on objects be called by #to_json and to produce a serialized 'flavor' of
the object breaks what ruby's semantics are supposed to be and those
should all be `#to_h` methods, and we should deprecate `#to_hash` but I
imagine that will be a reasonably large breaking change (Although
hopefully most of the use by users will be Node#to_hash which is
entirely correct usage since that thing is actually a kind of glorified
Hash-like monster).
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/shell')
-rw-r--r-- | spec/unit/shell/shell_session_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/unit/shell/shell_session_spec.rb b/spec/unit/shell/shell_session_spec.rb index ce66676196..2e32e6547d 100644 --- a/spec/unit/shell/shell_session_spec.rb +++ b/spec/unit/shell/shell_session_spec.rb @@ -204,7 +204,7 @@ describe Shell::SoloLegacySession do allow(@session).to receive(:node_built?).and_return(true) kitteh = Chef::Resource::Cat.new("keyboard") @recipe.run_context.resource_collection << kitteh - expect(@session.resource_collection).to include(kitteh) + expect(@session.resource_collection.include?(kitteh)).to be true end it "returns definitions from its compilation object" do @@ -224,7 +224,8 @@ describe Shell::SoloLegacySession do keyboard_cat = Chef::Resource::Cat.new("keyboard_cat") @recipe.run_context.resource_collection << keyboard_cat # @session.rebuild_collection - expect(@session.resource_collection).to include(kitteh_cat, keyboard_cat) + expect(@session.resource_collection.include?(kitteh_cat)).to be true + expect(@session.resource_collection.include?(keyboard_cat)).to be true end it "runs chef with a resource collection from the compiled cookbooks" do |