diff options
author | Luke Kanies <luke@madstop.com> | 2009-08-01 16:39:27 -0700 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-08-02 16:43:04 +1000 |
commit | dc244723bb23fe49b51cbb74bc372303d29fd180 (patch) | |
tree | f032ea1443ce9829b8983b7e0fd1c27f09e727ab | |
parent | 58d95872ce5afddc158ac4b229363c5f63859c5d (diff) | |
download | puppet-dc244723bb23fe49b51cbb74bc372303d29fd180.tar.gz puppet-dc244723bb23fe49b51cbb74bc372303d29fd180.tar.xz puppet-dc244723bb23fe49b51cbb74bc372303d29fd180.zip |
Adding a test for the Exec type
I thought I'd found a bug, but I couldn't reproduce
it. This test was supposed to demonstrate the bug,
but is at least good enough to leave in.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rwxr-xr-x | spec/unit/type/exec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/type/exec.rb b/spec/unit/type/exec.rb index 5f2fe5fa8..816e01bcc 100755 --- a/spec/unit/type/exec.rb +++ b/spec/unit/type/exec.rb @@ -89,3 +89,16 @@ describe Puppet::Type.type(:exec), " when logoutput=>on_failure is set," do @execer.refresh end end + +describe Puppet::Type.type(:exec) do + it "should be able to autorequire files mentioned in the command" do + catalog = Puppet::Resource::Catalog.new + catalog.add_resource Puppet::Type.type(:file).new(:name => "/bin/true") + @execer = Puppet::Type.type(:exec).new(:name => "/bin/true") + catalog.add_resource @execer + + rels = @execer.autorequire + rels[0].should be_instance_of(Puppet::Relationship) + rels[0].target.should equal(@execer) + end +end |