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


The following commit has been merged in the upstream branch:
commit aab2374378e0db03e4657e327460406bc31da2c2
Author: Markus Roberts <Markus at reality.com>
Date:   Fri Jan 8 17:22:49 2010 -0800

    Resolving conflicts with luke:tickets/testing/2954

diff --git a/lib/puppet/dsl/resource_api.rb b/lib/puppet/dsl/resource_api.rb
index bac26d3..98e5215 100644
--- a/lib/puppet/dsl/resource_api.rb
+++ b/lib/puppet/dsl/resource_api.rb
@@ -53,7 +53,7 @@ class Puppet::DSL::ResourceAPI
         raise ArgumentError, "Resource arguments must be provided as a hash" unless arguments.is_a?(Hash)
 
         names.collect do |name|
-            resource = Puppet::Parser::Resource.new(:type => type, :title => name, :scope => scope)
+            resource = Puppet::Parser::Resource.new(type, name, :scope => scope)
             arguments.each do |param, value|
                 resource[param] = value
             end
diff --git a/spec/unit/dsl/resource_api.rb b/spec/unit/dsl/resource_api.rb
index ddfc4e4..628e8c8 100755
--- a/spec/unit/dsl/resource_api.rb
+++ b/spec/unit/dsl/resource_api.rb
@@ -6,9 +6,9 @@ require 'puppet/dsl/resource_api'
 
 describe Puppet::DSL::ResourceAPI do
     before do
-        @compiler = stub 'compiler', :add_resource => nil
-        @scope = stub 'scope', :source => stub("source"), :compiler => @compiler
-        @resource = Puppet::Parser::Resource.new(:type => :mytype, :title => "myresource", :scope => @scope)
+        @compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("foo"))
+        @scope = Puppet::Parser::Scope.new(:compiler => @compiler, :source => "foo")
+        @resource = Puppet::Parser::Resource.new(:mytype, "myresource", :scope => @scope)
         @api = Puppet::DSL::ResourceAPI.new(@resource, @scope, proc { })
     end
 
@@ -85,29 +85,29 @@ describe Puppet::DSL::ResourceAPI do
     describe "when creating a resource" do
         before do
             @api.scope.stubs(:source).returns stub("source")
-            @api.scope.stubs(:compiler).returns stub("compiler", :add_resource => nil)
-            @created_resource = Puppet::Parser::Resource.new(:title => "eh", :type => 'yay', :scope => @api.scope)
+            @api.scope.compiler.stubs(:add_resource)
+            @created_resource = Puppet::Parser::Resource.new("yay", "eh", :scope => @api.scope)
         end
 
         it "should create and return a resource of the type specified" do
-            Puppet::Parser::Resource.expects(:new).with { |args| args[:type] == "mytype" }.returns @created_resource
+            Puppet::Parser::Resource.expects(:new).with { |type, title, args| type == "mytype" }.returns @created_resource
             @api.create_resource("mytype", "myname", {:foo => "bar"}).should == [@created_resource]
         end
 
         it "should use the name from the first element of the provided argument array" do
-            Puppet::Parser::Resource.expects(:new).with { |args| args[:title] == "myname" }.returns @created_resource
+            Puppet::Parser::Resource.expects(:new).with { |type, title, args| title == "myname" }.returns @created_resource
             @api.create_resource("mytype", "myname", {:foo => "bar"})
         end
 
         it "should create multiple resources if the first element of the argument array is an array" do
-            second_resource = Puppet::Parser::Resource.new(:title => "eh", :type => 'yay', :scope => @api.scope)
-            Puppet::Parser::Resource.expects(:new).with { |args| args[:title] == "first" }.returns @created_resource
-            Puppet::Parser::Resource.expects(:new).with { |args| args[:title] == "second" }.returns @created_resource
+            second_resource = Puppet::Parser::Resource.new('yay', "eh", :scope => @api.scope)
+            Puppet::Parser::Resource.expects(:new).with { |type, title, args| title == "first" }.returns @created_resource
+            Puppet::Parser::Resource.expects(:new).with { |type, title, args| title == "second" }.returns @created_resource
             @api.create_resource("mytype", ["first", "second"], {:foo => "bar"})
         end
 
         it "should provide its scope as the scope" do
-            Puppet::Parser::Resource.expects(:new).with { |args| args[:scope] == @api.scope }.returns @created_resource
+            Puppet::Parser::Resource.expects(:new).with { |type, title, args| args[:scope] == @api.scope }.returns @created_resource
             @api.create_resource("mytype", "myname", {:foo => "bar"})
         end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list