summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-09-07 17:12:33 -0700
committerTim Smith <tsmith@chef.io>2017-09-07 17:12:33 -0700
commitca52d67a4e033d83225e63e6a853c42b0a36329d (patch)
tree347cd64c08169ea117b1fa6f8e1e96a1692582bb
parent19c1d333ea04b98b1cfeffe2752c770e228a77a7 (diff)
downloadohai-ca52d67a4e033d83225e63e6a853c42b0a36329d.tar.gz
Minor tweaks to the ec2 / softlayer specs
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/unit/mixin/softlayer_metadata_spec.rb2
-rw-r--r--spec/unit/plugins/ec2_spec.rb6
2 files changed, 3 insertions, 5 deletions
diff --git a/spec/unit/mixin/softlayer_metadata_spec.rb b/spec/unit/mixin/softlayer_metadata_spec.rb
index 6fe2ddee..ec20e12b 100644
--- a/spec/unit/mixin/softlayer_metadata_spec.rb
+++ b/spec/unit/mixin/softlayer_metadata_spec.rb
@@ -36,7 +36,7 @@ describe ::Ohai::Mixin::SoftlayerMetadata do
end
context "fetch_metadata" do
- it "riases error if softlayer api query results with error" do
+ it "raises error if softlayer api query results with error" do
http_mock = double("http", { :ssl_version= => true, :use_ssl= => true, :ca_file= => true })
allow(http_mock).to receive(:get).and_raise(StandardError.new("API return fake error"))
allow(::Net::HTTP).to receive(:new).with("api.service.softlayer.com", 443).and_return(http_mock)
diff --git a/spec/unit/plugins/ec2_spec.rb b/spec/unit/plugins/ec2_spec.rb
index bf59c205..2f6e3aae 100644
--- a/spec/unit/plugins/ec2_spec.rb
+++ b/spec/unit/plugins/ec2_spec.rb
@@ -23,14 +23,14 @@ require "base64"
describe Ohai::System, "plugin ec2" do
+ let(:plugin) { get_plugin("ec2") }
+
before(:each) do
allow(plugin).to receive(:hint?).with("ec2").and_return(false)
allow(File).to receive(:exist?).with("/sys/hypervisor/uuid").and_return(false)
end
shared_examples_for "!ec2" do
- let(:plugin) { get_plugin("ec2") }
-
it "DOESN'T attempt to fetch the ec2 metadata or set ec2 attribute" do
expect(plugin).not_to receive(:http_client)
expect(plugin[:ec2]).to be_nil
@@ -39,8 +39,6 @@ describe Ohai::System, "plugin ec2" do
end
shared_examples_for "ec2" do
- let(:plugin) { get_plugin("ec2") }
-
before(:each) do
@http_client = double("Net::HTTP client")
allow(plugin).to receive(:http_client).and_return(@http_client)