summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTheodore Nordsieck <theo@opscode.com>2013-09-06 10:27:42 -0700
committerTheodore Nordsieck <theo@opscode.com>2013-09-11 16:13:21 -0700
commit1158eb358fbbe67269852e3d6b62ab8ebfa0e7a7 (patch)
tree8b7b50c293f37837cf140378ee959dde175e0d64 /spec
parent1864fe0dd017a2a590ae1678b7b48adafbce780d (diff)
downloadohai-1158eb358fbbe67269852e3d6b62ab8ebfa0e7a7.tar.gz
Add a wrapper for Mixlib::ShellOut
Diffstat (limited to 'spec')
-rw-r--r--spec/spec_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index d42b2b7b..1501d125 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -42,6 +42,14 @@ def it_should_check_from_mash(plugin, attribute, from, value)
end
end
+def mock_shell_out(exitstatus, stdout, stderr)
+ shell_out = double("mixlib_shell_out")
+ shell_out.stub(:exitstatus).and_return(exitstatus)
+ shell_out.stub(:stdout).and_return(stdout)
+ shell_out.stub(:stderr).and_return(stderr)
+ shell_out
+end
+
# the mash variable may be an array listing multiple levels of Mash hierarchy
def it_should_check_from_deep_mash(plugin, mash, attribute, from, value)
it "should get the #{mash.inspect}[:#{attribute}] value from '#{from}'" do