I'd prefer to see this test the results of eval_generate, rather than
applying the catalog.
Using a transaction basically makes it an integration test, IMO. It
should be pretty straightforward to make sure eval_generate produces
the file resource you want.
On Sep 17, 2008, at 10:40 AM, Paul Nasrat wrote:
>
> Signed-off-by: Paul Nasrat <[EMAIL PROTECTED]>
> ---
> spec/unit/type/file.rb | 18 ++++++++++++++++++
> 1 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb
> index 3ea4c37..675cbe9 100755
> --- a/spec/unit/type/file.rb
> +++ b/spec/unit/type/file.rb
> @@ -109,6 +109,24 @@ describe Puppet::Type.type(:file) do
>
> ("%o" % (File.stat(@file).mode & 007777)).should == "%o"
> % 0755
> end
> +
> + it "should default to copy dangling symlinks as links" do
> + todir = tempfile
> + Dir.mkdir(todir)
> + dangling_link = File.join(@basedir, "dangling_link")
> + File.symlink("/some/where/else", dangling_link)
> + @symlink_resource = Puppet.type(:file).create(
> + :path => todir,
> + :source => @basedir,
> + :ensure => "directory",
> + :recurse => true
> + )
> +
> + @catalog.add_resource @symlink_resource
> + @catalog.apply
> +
> + Dir.entries(todir).should include ["dangling_link",
> "file", "link"]
> + end
> end
>
> after do
> --
> 1.5.3.4
>
>
> >
--
I respect faith, but doubt is what gets you an education.
-- Wilson Mizner
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---