diff options
| author | Luke Kanies <luke@madstop.com> | 2008-11-05 23:04:33 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-11-05 23:04:33 -0600 |
| commit | 0149e2e125fc09bb5a8c1ff206cd46e06c0593cd (patch) | |
| tree | a97f8bd6e045ec2aaf9a25682f341425b5d3b481 /spec/integration | |
| parent | 35c623e65b44fed098374288e8c1dfc450a1f9f7 (diff) | |
| download | puppet-0149e2e125fc09bb5a8c1ff206cd46e06c0593cd.tar.gz puppet-0149e2e125fc09bb5a8c1ff206cd46e06c0593cd.tar.xz puppet-0149e2e125fc09bb5a8c1ff206cd46e06c0593cd.zip | |
Converting the file 'source' property to a parameter.
This makes a lot of sense because source was always
more of a metaparameter than a property -- it affected
the 'should' values of other properties, but it shouldn't
have done any other work.
It will hopefully make everything else much cleaner.
This is such a large commit mostly because of the need
to fix a lot of tests.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/integration')
| -rwxr-xr-x | spec/integration/type/file.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/integration/type/file.rb b/spec/integration/type/file.rb index c9e0d19c6..5e32332d3 100755 --- a/spec/integration/type/file.rb +++ b/spec/integration/type/file.rb @@ -175,10 +175,39 @@ describe Puppet::Type.type(:file) do # And make sure it's changed File.read(dest).should == "bar" + end + + it "should be able to copy individual files even if recurse has been specified" do + source = tmpfile("source") + dest = tmpfile("dest") + + File.open(source, "w") { |f| f.print "foo" } + + file = Puppet::Type::File.create(:name => dest, :source => source, :recurse => true) + catalog = Puppet::Node::Catalog.new + catalog.add_resource file + catalog.apply + + File.read(dest).should == "foo" end end + it "should be able to create files when 'content' is specified but 'ensure' is not" do + dest = tmpfile("files_with_content") + + file = Puppet.type(:file).create( + :name => dest, + :content => "this is some content, yo" + ) + + catalog = Puppet::Node::Catalog.new + catalog.add_resource file + catalog.apply + + File.read(dest).should == "this is some content, yo" + end + it "should create files with content if both 'content' and 'ensure' are set" do dest = tmpfile("files_with_content") |
