summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider/exec/shell_spec.rb
diff options
context:
space:
mode:
authorMax Martin <max@puppetlabs.com>2011-03-17 12:14:49 -0700
committerMax Martin <max@puppetlabs.com>2011-03-17 12:14:49 -0700
commitec1aa192825f17afbe4dc12be1e0f2d644d74155 (patch)
tree2cea3d2956e8d36711276edd31e968fbbb0eb618 /spec/unit/provider/exec/shell_spec.rb
parent0d2d6f3f005ee99658ff86b79749f0ba7949beab (diff)
downloadpuppet-ec1aa192825f17afbe4dc12be1e0f2d644d74155.tar.gz
puppet-ec1aa192825f17afbe4dc12be1e0f2d644d74155.tar.xz
puppet-ec1aa192825f17afbe4dc12be1e0f2d644d74155.zip
(#4884) Revise new exec tests, add a few more
Revised a few of the new tests for the exec type and provider to ensure that they were testing what they meant to, and added in a couple of new tests. Reviewed-by:Daniel Pittman
Diffstat (limited to 'spec/unit/provider/exec/shell_spec.rb')
-rw-r--r--spec/unit/provider/exec/shell_spec.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/unit/provider/exec/shell_spec.rb b/spec/unit/provider/exec/shell_spec.rb
index 44390ff08..a9b1f06ba 100644
--- a/spec/unit/provider/exec/shell_spec.rb
+++ b/spec/unit/provider/exec/shell_spec.rb
@@ -11,21 +11,27 @@ describe provider_class do
describe "#run" do
it "should be able to run builtin shell commands" do
- output, status = @provider.run("echo foo")
+ output, status = @provider.run("if [ 1 == 1 ]; then echo 'blah'; fi")
status.exitstatus.should == 0
- output.should == "foo\n"
+ output.should == "blah\n"
end
it "should be able to run commands with single quotes in them" do
- output, status = @provider.run("echo 'foo bar'")
+ output, status = @provider.run("echo 'foo bar'")
status.exitstatus.should == 0
- output.should == "foo bar\n"
+ output.should == "foo bar\n"
end
it "should be able to run commands with double quotes in them" do
- output, status = @provider.run("echo 'foo bar'")
+ output, status = @provider.run('echo "foo bar"')
status.exitstatus.should == 0
- output.should == "foo bar\n"
+ output.should == "foo bar\n"
+ end
+
+ it "should be able to run multiple commands separated by a semicolon" do
+ output, status = @provider.run("echo 'foo' ; echo 'bar'")
+ status.exitstatus.should == 0
+ output.should == "foo\nbar\n"
end
it "should be able to read values from the environment parameter" do