summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/freebsd
diff options
context:
space:
mode:
authorClaire McQuin <claire@opscode.com>2013-08-21 11:13:06 -0700
committerClaire McQuin <claire@opscode.com>2013-08-21 11:13:06 -0700
commit56e606073ceae86f98c58ae1e7fea6d0029fc9b5 (patch)
treedc9f226033d1573f1d97e4a94c940485009b292a /spec/unit/plugins/freebsd
parent8a95352b53e3806166da79158b94b90e21f787c2 (diff)
downloadohai-56e606073ceae86f98c58ae1e7fea6d0029fc9b5.tar.gz
add plugin loading to common spec
Diffstat (limited to 'spec/unit/plugins/freebsd')
-rw-r--r--spec/unit/plugins/freebsd/hostname_spec.rb4
-rw-r--r--spec/unit/plugins/freebsd/kernel_spec.rb4
-rw-r--r--spec/unit/plugins/freebsd/platform_spec.rb4
-rw-r--r--spec/unit/plugins/freebsd/virtualization_spec.rb4
4 files changed, 4 insertions, 12 deletions
diff --git a/spec/unit/plugins/freebsd/hostname_spec.rb b/spec/unit/plugins/freebsd/hostname_spec.rb
index 81555e6e..b1afb212 100644
--- a/spec/unit/plugins/freebsd/hostname_spec.rb
+++ b/spec/unit/plugins/freebsd/hostname_spec.rb
@@ -21,9 +21,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
describe Ohai::System, "FreeBSD hostname plugin" do
before(:each) do
- ohai = Ohai::System.new
- loader = Ohai::Loader.new(ohai)
- @plugin = loader.load_plugin(File.expand_path("freebsd/hostname.rb", PLUGIN_PATH)).new(ohai)
+ @plugin = get_plugin("freebsd/hostname")
@plugin[:os] = "freebsd"
@plugin.stub(:from).with("hostname -s").and_return("katie")
@plugin.stub(:from).with("hostname -f").and_return("katie.bethell")
diff --git a/spec/unit/plugins/freebsd/kernel_spec.rb b/spec/unit/plugins/freebsd/kernel_spec.rb
index 52d0d370..079bb172 100644
--- a/spec/unit/plugins/freebsd/kernel_spec.rb
+++ b/spec/unit/plugins/freebsd/kernel_spec.rb
@@ -21,9 +21,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
describe Ohai::System, "FreeBSD kernel plugin" do
before(:each) do
- ohai = Ohai::System.new
- loader = Ohai::Loader.new(ohai)
- @plugin = loader.load_plugin(File.expand_path("freebsd/kernel.rb", PLUGIN_PATH)).new(ohai)
+ @plugin = get_plugin("freebsd/kernel")
@plugin.stub(:from).with("uname -i").and_return("foo")
@plugin.stub(:from_with_regex).with("sysctl kern.securelevel", /kern.securelevel: (.+)$/).and_return("kern.securelevel: 1")
@plugin.stub(:popen4).with("/sbin/kldstat").and_yield(0, StringIO.new, StringIO.new, StringIO.new)
diff --git a/spec/unit/plugins/freebsd/platform_spec.rb b/spec/unit/plugins/freebsd/platform_spec.rb
index ce686248..76dadb98 100644
--- a/spec/unit/plugins/freebsd/platform_spec.rb
+++ b/spec/unit/plugins/freebsd/platform_spec.rb
@@ -21,9 +21,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
describe Ohai::System, "FreeBSD plugin platform" do
before(:each) do
- ohai = Ohai::System.new
- loader = Ohai::Loader.new(ohai)
- @plugin = loader.load_plugin(File.expand_path("freebsd/platform.rb", PLUGIN_PATH)).new(ohai)
+ @plugin = get_plugin("freebsd/platform")
@plugin.stub(:from).with("uname -s").and_return("FreeBSD")
@plugin.stub(:from).with("uname -r").and_return("7.1")
@plugin[:os] = "freebsd"
diff --git a/spec/unit/plugins/freebsd/virtualization_spec.rb b/spec/unit/plugins/freebsd/virtualization_spec.rb
index fdcda147..c54ed9e8 100644
--- a/spec/unit/plugins/freebsd/virtualization_spec.rb
+++ b/spec/unit/plugins/freebsd/virtualization_spec.rb
@@ -21,9 +21,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
describe Ohai::System, "FreeBSD virtualization plugin" do
before(:each) do
- ohai = Ohai::System.new
- loader = Ohai::Loader.new(ohai)
- @plugin = loader.load_plugin(File.expand_path("freebsd/virtualization.rb", PLUGIN_PATH)).new(ohai)
+ @plugin = get_plugin("freebsd/virtualization")
@plugin[:os] = "freebsd"
@stderr = StringIO.new
@stdin = StringIO.new