summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-01-22 15:48:00 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2020-01-22 15:48:00 -0800
commitbc309d9536405af84becb91ef82792bc43697a72 (patch)
tree36d9c2b26b5f9098baf03288c1b0c85230ee83a4
parent689acdb48bb2910de168d4a9d7add0f646a8d7fa (diff)
downloadchef-bc309d9536405af84becb91ef82792bc43697a72.tar.gz
more fixes to the ruby 2.7 fixes
this should pass on both now Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/resource_spec.rb9
-rw-r--r--spec/unit/search/query_spec.rb2
2 files changed, 9 insertions, 2 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 2f002f144a..24cc5faea1 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -910,7 +910,14 @@ describe Chef::Resource do
klz.provides :energy, platform: %w{autobots decepticons}
end
- it "adds mappings for all platforms" do
+ it "adds mappings for all platforms", ruby: "< 2.7" do
+ expect(Chef.resource_handler_map).to receive(:set).with(
+ :tape_deck, Chef::Resource::Klz, {}
+ )
+ klz.provides :tape_deck
+ end
+
+ it "adds mappings for all platforms", ruby: ">= 2.7" do
expect(Chef.resource_handler_map).to receive(:set).with(
:tape_deck, Chef::Resource::Klz
)
diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb
index 7dba88de8b..9b0087d7ed 100644
--- a/spec/unit/search/query_spec.rb
+++ b/spec/unit/search/query_spec.rb
@@ -195,7 +195,7 @@ describe Chef::Search::Query do
it "throws an exception if you pass an incorrect option" do
expect { query.search(:node, "platform:rhel", total: 10) }
- .to raise_error(ArgumentError, /unknown keyword: :+total/)
+ .to raise_error(ArgumentError, /unknown keyword: :?total/)
end
it "returns the raw rows, start, and total if no block is passed" do