[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:32:06 UTC 2010


The following commit has been merged in the upstream branch:
commit e515513b5cb065f3e43f5c2880d0452d8e2b25b8
Author: Luke Kanies <luke at reductivelabs.com>
Date:   Thu Jan 7 22:55:09 2010 -0800

    Adding environment support to parser resources
    
    We just use the scope's environment.
    
    Signed-off-by: Luke Kanies <luke at reductivelabs.com>

diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index 2e630a2..7fcb7c1 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -9,8 +9,10 @@ class Puppet::Parser::Resource < Puppet::Resource
     require 'puppet/util/tagging'
     require 'puppet/file_collection/lookup'
     require 'puppet/parser/yaml_trimmer'
+    require 'puppet/resource/type_collection_helper'
 
     include Puppet::FileCollection::Lookup
+    include Puppet::Resource::TypeCollectionHelper
 
     include Puppet::Util
     include Puppet::Util::MethodHelper
diff --git a/spec/unit/parser/resource.rb b/spec/unit/parser/resource.rb
index 57c03c6..9836910 100755
--- a/spec/unit/parser/resource.rb
+++ b/spec/unit/parser/resource.rb
@@ -69,6 +69,15 @@ describe Puppet::Parser::Resource do
         Puppet::Parser::Resource.new("file", "whatever", :scope => scope).namespaces.should == %w{one two}
     end
 
+    it "should use the resource type collection helper module" do
+        Puppet::Parser::Resource.ancestors.should be_include(Puppet::Resource::TypeCollectionHelper)
+    end
+
+    it "should use the scope's environment as its environment" do
+        @scope.expects(:environment).returns "myenv"
+        Puppet::Parser::Resource.new(:type => "file", :title => "whatever", :scope => @scope).environment.should == "myenv"
+    end
+
     it "should be isomorphic if it is builtin and models an isomorphic type" do
         Puppet::Type.type(:file).expects(:isomorphic?).returns(true)
         @resource = Puppet::Parser::Resource.new("file", "whatever", :scope => @scope, :source => @source).isomorphic?.should be_true

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list