diff options
author | John McCrae <john.mccrae@progress.com> | 2022-04-20 09:08:43 -0700 |
---|---|---|
committer | John McCrae <john.mccrae@progress.com> | 2022-04-20 09:08:43 -0700 |
commit | d27e6f2d7fcd0b835f5c89040c08744b364c7a2e (patch) | |
tree | 865ab021c6d5580f48729803c22b5516eb40fb38 | |
parent | 8a60e98189ffce002ec6e864da4487d85667cbb9 (diff) | |
download | ohai-d27e6f2d7fcd0b835f5c89040c08744b364c7a2e.tar.gz |
Updated Testing Ruby 3.1 support to get past metadata errors
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r-- | spec/unit/mixin/azure_metadata_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/mixin/azure_metadata_spec.rb b/spec/unit/mixin/azure_metadata_spec.rb index 21e6febe..0a3c0455 100644 --- a/spec/unit/mixin/azure_metadata_spec.rb +++ b/spec/unit/mixin/azure_metadata_spec.rb @@ -55,10 +55,10 @@ describe Ohai::Mixin::AzureMetadata do end context "when azure doesn't return any versions we know about" do - let(:response) { double("Net::HTTP Response", body: "{\"error\":\"Bad request. api-version was not specified in the request. For more information refer to aka.ms/azureimds\",\"newest-versions\":[\"2021-01-02\",\"2020-08-01\",\"2020-07-15\"]}", code: "400") } + let(:response) { double("Net::HTTP Response", body: "{\"error\":\"Bad request. api-version was not specified in the request. For more information refer to aka.ms/azureimds\",\"newest-versions\":[\"2020-12-01\",\"2020-10-01\",\"2020-09-01\"]}", code: "400") } it "returns the most recent version we know of" do - expect(mixin.best_api_version).to eq("2019-11-01") + expect(mixin.best_api_version).to eq("2020-12-01") end end @@ -66,12 +66,12 @@ describe Ohai::Mixin::AzureMetadata do let(:response) { double("Net::HTTP Response", code: "404") } it "returns the most recent version we know of" do - expect(mixin.best_api_version).to eq("2019-11-01") + expect(mixin.best_api_version).to eq("2021-10-01") end end context "when the response code is unexpected" do - let(:response) { double("Net::HTTP Response", body: "{\"error\":\"Bad request. api-version was not specified in the request. For more information refer to aka.ms/azureimds\",\"newest-versions\":[\"2021-01-02\",\"2020-08-01\",\"2020-07-15\"]}", code: "418") } + let(:response) { double("Net::HTTP Response", body: "{\"error\":\"Bad request. api-version was not specified in the request. For more information refer to aka.ms/azureimds\",\"newest-versions\":[\"2021-10-01\",\"2021-05-01\",\"2021-03-01\"]}", code: "418") } it "raises an error" do expect { mixin.best_api_version }.to raise_error(RuntimeError) @@ -81,7 +81,7 @@ describe Ohai::Mixin::AzureMetadata do describe "#fetch_metadata" do before do - allow(mixin).to receive(:best_api_version).and_return("2019-11-01") + allow(mixin).to receive(:best_api_version).and_return("2021-10-01") end it "returns an empty hash given a non-200 response" do |