diff options
author | sawanoboly <sawanoboriyu@higanworks.com> | 2020-12-10 15:59:08 +0900 |
---|---|---|
committer | sawanoboly <sawanoboriyu@higanworks.com> | 2020-12-10 15:59:26 +0900 |
commit | dc6955ed7b9a04f58991857605513da2d17bbb44 (patch) | |
tree | ce9aeaf6212a6f533610cf1f70e92e31daa40902 | |
parent | 079decf4bde71c046e59a9784f5b030db51c68dc (diff) | |
download | ohai-dc6955ed7b9a04f58991857605513da2d17bbb44.tar.gz |
include info for returns of meta-data/iam/
Signed-off-by: sawanoboly <sawanoboriyu@higanworks.com>
-rw-r--r-- | spec/unit/mixin/ec2_metadata_spec.rb | 12 | ||||
-rw-r--r-- | spec/unit/plugins/ec2_spec.rb | 99 | ||||
-rw-r--r-- | spec/unit/plugins/eucalyptus_spec.rb | 12 |
3 files changed, 61 insertions, 62 deletions
diff --git a/spec/unit/mixin/ec2_metadata_spec.rb b/spec/unit/mixin/ec2_metadata_spec.rb index fd53208b..4579686b 100644 --- a/spec/unit/mixin/ec2_metadata_spec.rb +++ b/spec/unit/mixin/ec2_metadata_spec.rb @@ -35,14 +35,14 @@ describe Ohai::Mixin::Ec2Metadata do describe "#best_api_version" do context "with a sorted list of metadata versions" do - let(:response) { double("Net::HTTP::GET Response", body: "1.0\n2011-05-01\n2012-01-12\nUnsupported", code: "200") } + let(:response) { double("Net::HTTP Response", body: "1.0\n2011-05-01\n2012-01-12\nUnsupported", code: "200") } it "returns the most recent version" do expect(mixin.best_api_version).to eq("2012-01-12") end end context "with an unsorted list of metadata versions" do - let(:response) { double("Net::HTTP::GET Response", body: "1.0\n2009-04-04\n2007-03-01\n2011-05-01\n2008-09-01\nUnsupported", code: "200") } + let(:response) { double("Net::HTTP Response", body: "1.0\n2009-04-04\n2007-03-01\n2011-05-01\n2008-09-01\nUnsupported", code: "200") } it "returns the most recent version (using string sort)" do expect(mixin.best_api_version).to eq("2011-05-01") @@ -50,7 +50,7 @@ describe Ohai::Mixin::Ec2Metadata do end context "when no supported versions are found" do - let(:response) { double("Net::HTTP::GET Response", body: "2020-01-01\nUnsupported", code: "200") } + let(:response) { double("Net::HTTP Response", body: "2020-01-01\nUnsupported", code: "200") } it "raises an error" do expect { mixin.best_api_version }.to raise_error(RuntimeError) @@ -59,7 +59,7 @@ describe Ohai::Mixin::Ec2Metadata do # Presume 'latest' when we get a 404 for Eucalyptus back-compat context "when the response code is 404" do - let(:response) { double("Net::HTTP::GET Response", code: "404") } + let(:response) { double("Net::HTTP Response", code: "404") } it "returns 'latest' as the version" do expect(mixin.best_api_version).to eq("latest") @@ -67,7 +67,7 @@ describe Ohai::Mixin::Ec2Metadata do end context "when the response code is unexpected" do - let(:response) { double("Net::HTTP::GET Response", body: "1.0\n2011-05-01\n2012-01-12\nUnsupported", code: "418") } + let(:response) { double("Net::HTTP Response", body: "1.0\n2011-05-01\n2012-01-12\nUnsupported", code: "418") } it "raises an error" do expect { mixin.best_api_version }.to raise_error(RuntimeError) @@ -84,7 +84,7 @@ describe Ohai::Mixin::Ec2Metadata do describe "#metadata_get" do context "when the response code is unexpected" do - let(:response) { double("Net::HTTP::GET Response", body: "", code: "418") } + let(:response) { double("Net::HTTP Response", body: "", code: "418") } it "raises an error" do expect { mixin.metadata_get("", "2012-01-12") }.to raise_error(RuntimeError) diff --git a/spec/unit/plugins/ec2_spec.rb b/spec/unit/plugins/ec2_spec.rb index dbb19715..75a9c529 100644 --- a/spec/unit/plugins/ec2_spec.rb +++ b/spec/unit/plugins/ec2_spec.rb @@ -51,7 +51,7 @@ describe Ohai::System, "plugin ec2" do allow(@http_client).to receive(:put) { double("Net::HTTP::PUT Response", body: token, code: "200") } expect(@http_client).to receive(:get) .with("/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "2012-01-12", code: "200")) + .and_return(double("Net::HTTP Response", body: "2012-01-12", code: "200")) end context "with common metadata paths" do @@ -67,14 +67,14 @@ describe Ohai::System, "plugin ec2" do paths.each do |name, body| expect(@http_client).to receive(:get) .with("/2012-01-12/#{name}", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: body, code: "200")) + .and_return(double("Net::HTTP Response", body: body, code: "200")) end expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "By the pricking of my thumb...", code: "200")) + .and_return(double("Net::HTTP Response", body: "By the pricking of my thumb...", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) plugin.run @@ -88,14 +88,14 @@ describe Ohai::System, "plugin ec2" do paths.each do |name, body| expect(@http_client).to receive(:get) .with("/2012-01-12/#{name}", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: body, code: "200")) + .and_return(double("Net::HTTP Response", body: body, code: "200")) end expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "^_<8B>^H^H<C7>U^@^Csomething^@KT<C8><C9>,)<C9>IU(I-.I<CB><CC>I<E5>^B^@^Qz<BF><B0>^R^@^@^@", code: "200")) + .and_return(double("Net::HTTP Response", body: "^_<8B>^H^H<C7>U^@^Csomething^@KT<C8><C9>,)<C9>IU(I-.I<CB><CC>I<E5>^B^@^Qz<BF><B0>^R^@^@^@", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) plugin.run @@ -110,14 +110,14 @@ describe Ohai::System, "plugin ec2" do paths.each do |name, body| expect(@http_client).to receive(:get) .with("/2012-01-12/#{name}", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: body, code: "200")) + .and_return(double("Net::HTTP Response", body: body, code: "200")) end expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "^_<8B>^H^H<C7>U^@^Csomething^@KT<C8><C9>,)<C9>IU(I-.I<CB><CC>I<E5>^B^@^Qz<BF><B0>^R^@^@^@", code: "200")) + .and_return(double("Net::HTTP Response", body: "^_<8B>^H^H<C7>U^@^Csomething^@KT<C8><C9>,)<C9>IU(I-.I<CB><CC>I<E5>^B^@^Qz<BF><B0>^R^@^@^@", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) plugin.run @@ -132,14 +132,14 @@ describe Ohai::System, "plugin ec2" do paths.each do |name, body| expect(@http_client).to receive(:get) .with("/2012-01-12/#{name}", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: body, code: "200")) + .and_return(double("Net::HTTP Response", body: body, code: "200")) end expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "^_<8B>^H^H<C7>U^@^Csomething^@KT<C8><C9>,)<C9>IU(I-.I<CB><CC>I<E5>^B^@^Qz<BF><B0>^R^@^@^@", code: "200")) + .and_return(double("Net::HTTP Response", body: "^_<8B>^H^H<C7>U^@^Csomething^@KT<C8><C9>,)<C9>IU(I-.I<CB><CC>I<E5>^B^@^Qz<BF><B0>^R^@^@^@", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"region\":\"us-east-1\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"region\":\"us-east-1\"}", code: "200")) plugin.run @@ -154,14 +154,14 @@ describe Ohai::System, "plugin ec2" do paths.each do |name, body| expect(@http_client).to receive(:get) .with("/2012-01-12/#{name}", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: body, code: "200")) + .and_return(double("Net::HTTP Response", body: body, code: "200")) end expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "^_<8B>^H^H<C7>U^@^Csomething^@KT<C8><C9>,)<C9>IU(I-.I<CB><CC>I<E5>^B^@^Qz<BF><B0>^R^@^@^@", code: "200")) + .and_return(double("Net::HTTP Response", body: "^_<8B>^H^H<C7>U^@^Csomething^@KT<C8><C9>,)<C9>IU(I-.I<CB><CC>I<E5>^B^@^Qz<BF><B0>^R^@^@^@", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"availabilityZone\":\"us-east-1d\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"availabilityZone\":\"us-east-1d\"}", code: "200")) plugin.run @@ -176,28 +176,28 @@ describe Ohai::System, "plugin ec2" do it "parses ec2 network/ directory as a multi-level hash" do expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "network/", code: "200")) + .and_return(double("Net::HTTP Response", body: "network/", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/network/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "interfaces/", code: "200")) + .and_return(double("Net::HTTP Response", body: "interfaces/", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/network/interfaces/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "macs/", code: "200")) + .and_return(double("Net::HTTP Response", body: "macs/", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/network/interfaces/macs/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "12:34:56:78:9a:bc/", code: "200")) + .and_return(double("Net::HTTP Response", body: "12:34:56:78:9a:bc/", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/network/interfaces/macs/12:34:56:78:9a:bc/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "public_hostname", code: "200")) + .and_return(double("Net::HTTP Response", body: "public_hostname", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/network/interfaces/macs/12:34:56:78:9a:bc/public_hostname", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "server17.opscode.com", code: "200")) + .and_return(double("Net::HTTP Response", body: "server17.opscode.com", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "By the pricking of my thumb...", code: "200")) + .and_return(double("Net::HTTP Response", body: "By the pricking of my thumb...", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) plugin.run @@ -213,22 +213,22 @@ describe Ohai::System, "plugin ec2" do it "parses ec2 iam/ directory and collect iam/security-credentials/" do expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "iam/", code: "200")) + .and_return(double("Net::HTTP Response", body: "iam/", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/iam/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "security-credentials/", code: "200")) + .and_return(double("Net::HTTP Response", body: "security-credentials/", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/iam/security-credentials/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "MyRole", code: "200")) + .and_return(double("Net::HTTP Response", body: "MyRole", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/iam/security-credentials/MyRole", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2012-08-22T07:47:22Z\",\n \"Type\" : \"AWS-HMAC\",\n \"AccessKeyId\" : \"AAAAAAAA\",\n \"SecretAccessKey\" : \"SSSSSSSS\",\n \"Token\" : \"12345678\",\n \"Expiration\" : \"2012-08-22T11:25:52Z\"\n}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2012-08-22T07:47:22Z\",\n \"Type\" : \"AWS-HMAC\",\n \"AccessKeyId\" : \"AAAAAAAA\",\n \"SecretAccessKey\" : \"SSSSSSSS\",\n \"Token\" : \"12345678\",\n \"Expiration\" : \"2012-08-22T11:25:52Z\"\n}", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "By the pricking of my thumb...", code: "200")) + .and_return(double("Net::HTTP Response", body: "By the pricking of my thumb...", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) plugin.run @@ -246,28 +246,27 @@ describe Ohai::System, "plugin ec2" do it "parses ec2 iam/ directory and collect info and role_name and NOT collect iam/security-credentials/" do expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "iam/", code: "200")) + .and_return(double("Net::HTTP Response", body: "iam/", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/iam/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "security-credentials/", code: "200")) + .and_return(double("Net::HTTP Response", body: "info\nsecurity-credentials/", code: "200")) expect(@http_client).to receive(:get) - .with("/2012-01-12/meta-data/iam/info") + .with("/2012-01-12/meta-data/iam/info", @get_req_token_header) .and_return(double("Net::HTTP Response", body: "{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2020-10-08T20:47:08Z\",\n \"InstanceProfileArn\" : \"arn:aws:iam::111111111111:instance-profile/my_profile\",\n \"InstanceProfileId\" : \"AAAAAAAAAAAAAAAAAAAAA\"\n}", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/iam/security-credentials/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "MyRole", code: "200")) + .and_return(double("Net::HTTP Response", body: "MyRole", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/iam/security-credentials/MyRole", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2012-08-22T07:47:22Z\",\n \"Type\" : \"AWS-HMAC\",\n \"AccessKeyId\" : \"AAAAAAAA\",\n \"SecretAccessKey\" : \"SSSSSSSS\",\n \"Token\" : \"12345678\",\n \"Expiration\" : \"2012-08-22T11:25:52Z\"\n}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2012-08-22T07:47:22Z\",\n \"Type\" : \"AWS-HMAC\",\n \"AccessKeyId\" : \"AAAAAAAA\",\n \"SecretAccessKey\" : \"SSSSSSSS\",\n \"Token\" : \"12345678\",\n \"Expiration\" : \"2012-08-22T11:25:52Z\"\n}", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "By the pricking of my thumb...", code: "200")) + .and_return(double("Net::HTTP Response", body: "By the pricking of my thumb...", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) plugin.run - expect(plugin[:ec2]).not_to be_nil expect(plugin[:ec2]["iam"]["info"]["InstanceProfileId"]).to eql "AAAAAAAAAAAAAAAAAAAAA" expect(plugin[:ec2]["iam"]["security-credentials"]).to be_nil @@ -278,7 +277,7 @@ describe Ohai::System, "plugin ec2" do it "ignores \"./\" and \"../\" on ec2 metadata paths to avoid infinity loops" do expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: ".\n./\n..\n../\npath1/.\npath2/./\npath3/..\npath4/../", code: "200")) + .and_return(double("Net::HTTP Response", body: ".\n./\n..\n../\npath1/.\npath2/./\npath3/..\npath4/../", code: "200")) expect(@http_client).not_to receive(:get) .with("/2012-01-12/meta-data/.", @get_req_token_header) expect(@http_client).not_to receive(:get) @@ -292,22 +291,22 @@ describe Ohai::System, "plugin ec2" do expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/path1/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "", code: "200")) + .and_return(double("Net::HTTP Response", body: "", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/path2/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "", code: "200")) + .and_return(double("Net::HTTP Response", body: "", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/path3/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "", code: "200")) + .and_return(double("Net::HTTP Response", body: "", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/path4/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "", code: "200")) + .and_return(double("Net::HTTP Response", body: "", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "By the pricking of my thumb...", code: "200")) + .and_return(double("Net::HTTP Response", body: "By the pricking of my thumb...", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) plugin.run @@ -317,19 +316,19 @@ describe Ohai::System, "plugin ec2" do it "completes the run despite unavailable metadata" do expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "metrics/", code: "200")) + .and_return(double("Net::HTTP Response", body: "metrics/", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/metrics/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "vhostmd", code: "200")) + .and_return(double("Net::HTTP Response", body: "vhostmd", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/metrics/vhostmd", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "", code: "404")) + .and_return(double("Net::HTTP Response", body: "", code: "404")) expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "By the pricking of my thumb...", code: "200")) + .and_return(double("Net::HTTP Response", body: "By the pricking of my thumb...", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/dynamic/instance-identity/document/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) + .and_return(double("Net::HTTP Response", body: "{\"accountId\":\"4815162342\"}", code: "200")) plugin.run diff --git a/spec/unit/plugins/eucalyptus_spec.rb b/spec/unit/plugins/eucalyptus_spec.rb index ad1d22ca..24ac95d8 100644 --- a/spec/unit/plugins/eucalyptus_spec.rb +++ b/spec/unit/plugins/eucalyptus_spec.rb @@ -40,22 +40,22 @@ describe Ohai::System, "plugin eucalyptus" do expect(@http_client).to receive(:get) .with("/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "2012-01-12", code: "200")) + .and_return(double("Net::HTTP Response", body: "2012-01-12", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "instance_type\nami_id\nsecurity-groups", code: "200")) + .and_return(double("Net::HTTP Response", body: "instance_type\nami_id\nsecurity-groups", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/instance_type", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "c1.medium", code: "200")) + .and_return(double("Net::HTTP Response", body: "c1.medium", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/ami_id", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "ami-5d2dc934", code: "200")) + .and_return(double("Net::HTTP Response", body: "ami-5d2dc934", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/meta-data/security-groups", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "group1\ngroup2", code: "200")) + .and_return(double("Net::HTTP Response", body: "group1\ngroup2", code: "200")) expect(@http_client).to receive(:get) .with("/2012-01-12/user-data/", @get_req_token_header) - .and_return(double("Net::HTTP::GET Response", body: "By the pricking of my thumb...", code: "200")) + .and_return(double("Net::HTTP Response", body: "By the pricking of my thumb...", code: "200")) end it "recursively fetches all the eucalyptus metadata" do |