From dc244723bb23fe49b51cbb74bc372303d29fd180 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Sat, 1 Aug 2009 16:39:27 -0700 Subject: 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 --- spec/unit/type/exec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- cgit