diff options
author | Lamont Granquist <lamont@chef.io> | 2020-01-22 16:25:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-22 16:25:02 -0800 |
commit | db2ee4ae01be76f0238bdb86f3ba838a51533df9 (patch) | |
tree | 36d9c2b26b5f9098baf03288c1b0c85230ee83a4 | |
parent | b73683f46c63a3f310404afd7f52e07e14f31285 (diff) | |
parent | bc309d9536405af84becb91ef82792bc43697a72 (diff) | |
download | chef-db2ee4ae01be76f0238bdb86f3ba838a51533df9.tar.gz |
fix a few more ruby 2.7 specs (#9253)
fix a few more ruby 2.7 specs
-rw-r--r-- | spec/unit/resource_spec.rb | 11 | ||||
-rw-r--r-- | spec/unit/search/query_spec.rb | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 6745dd448d..24cc5faea1 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -3,7 +3,7 @@ # Author:: Christopher Walters (<cw@chef.io>) # Author:: Tim Hinderliter (<tim@chef.io>) # Author:: Seth Chisamore (<schisamo@chef.io>) -# Copyright:: Copyright 2008-2018, Chef Software Inc. +# Copyright:: Copyright 2008-2020, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -910,13 +910,20 @@ 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 + ) + klz.provides :tape_deck + end + end describe "resource_for_node" do diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb index 83f988911c..9b0087d7ed 100644 --- a/spec/unit/search/query_spec.rb +++ b/spec/unit/search/query_spec.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob (<adam@chef.io>) -# Copyright:: Copyright 2009-2017, Chef Software Inc. +# Copyright:: Copyright 2009-2020, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -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 |