summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2016-05-11 10:34:29 -0700
committerTim Smith <tsmith@chef.io>2017-02-23 12:58:58 -0800
commit6b5c7dbffdf36eb5aad5586d7ef9f66894a1d04d (patch)
tree64ecc17800ec48b8e6bac0d69707ab65d2054690
parentbfc14ea957603a7db5c7e2073a39e5273c49dfdc (diff)
downloadohai-6b5c7dbffdf36eb5aad5586d7ef9f66894a1d04d.tar.gz
Add spec for digital ocean DMI data flow
-rw-r--r--lib/ohai/plugins/digital_ocean.rb2
-rw-r--r--spec/unit/plugins/digital_ocean_spec.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/ohai/plugins/digital_ocean.rb b/lib/ohai/plugins/digital_ocean.rb
index 08daa600..240c4a10 100644
--- a/lib/ohai/plugins/digital_ocean.rb
+++ b/lib/ohai/plugins/digital_ocean.rb
@@ -52,7 +52,7 @@ Ohai.plugin(:DigitalOcean) do
Ohai::Log.debug("Plugin Digitalocean: looks_like_digital_ocean? == true")
digital_ocean Mash.new
fetch_metadata.each do |k, v|
- next if k == 'vendor_data' # this may have sensitive data we shouldn't store
+ next if k == "vendor_data" # this may have sensitive data we shouldn't store
digital_ocean[k] = v
end
else
diff --git a/spec/unit/plugins/digital_ocean_spec.rb b/spec/unit/plugins/digital_ocean_spec.rb
index 682ea73a..ad50cbd3 100644
--- a/spec/unit/plugins/digital_ocean_spec.rb
+++ b/spec/unit/plugins/digital_ocean_spec.rb
@@ -189,4 +189,12 @@ describe Ohai::System, "plugin digital_ocean" do
>>>>>>> Remove debug code/add proper has_do_init check. Attempt to fix failing tests
end
end
+
+ describe "with digital_ocean DMI data" do
+ it_should_behave_like "digital_ocean"
+
+ before(:each) do
+ plugin[:dmi] = { :bios => { :all_records => [ { :Vendor => "DigitalOcean" } ] } }
+ end
+ end
end