[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:31:38 UTC 2010


The following commit has been merged in the upstream branch:
commit 7bef2e0107451310bc8674134ee28168a4bdfe5d
Author: Luke Kanies <luke at reductivelabs.com>
Date:   Wed Jan 6 16:26:58 2010 -0800

    Adding helper module for finding known resource types
    
    This is so everyone doesn't have to define the same method
    everywhere.
    
    Signed-off-by: Luke Kanies <luke at reductivelabs.com>

diff --git a/lib/puppet/parser/resource_type_collection_helper.rb b/lib/puppet/parser/resource_type_collection_helper.rb
new file mode 100644
index 0000000..4f66c77
--- /dev/null
+++ b/lib/puppet/parser/resource_type_collection_helper.rb
@@ -0,0 +1,5 @@
+module Puppet::Parser::ResourceTypeCollectionHelper
+    def known_resource_types
+        environment.known_resource_types
+    end
+end
diff --git a/spec/unit/parser/resource_type_collection_helper.rb b/spec/unit/parser/resource_type_collection_helper.rb
new file mode 100644
index 0000000..c93c9f2
--- /dev/null
+++ b/spec/unit/parser/resource_type_collection_helper.rb
@@ -0,0 +1,25 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+require 'puppet/parser/resource_type_collection_helper'
+
+class RTCHelperTester
+    include Puppet::Parser::ResourceTypeCollectionHelper
+end
+
+describe Puppet::Parser::ResourceTypeCollectionHelper do
+    before do
+        @helper = RTCHelperTester.new
+    end
+
+    it "should use its current environment to retrieve the known resource type collection" do
+        env = stub 'environment'
+        @helper.expects(:environment).returns env
+
+        rtc = stub 'known_resource_types'
+        env.expects(:known_resource_types).returns  rtc
+
+        @helper.known_resource_types.should equal(rtc)
+    end
+end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list