[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:52 UTC 2009


The following commit has been merged in the master branch:
commit 3fe9cc748a7bca9b5fead1f9c1e0d82f1207bb3f
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Mon Dec 1 21:03:20 2008 +0100

    Fix #1741 - fix some failing tests on some ruby versions.
    
    Nigelk reported those tests were failing on ubuntu 8.04.
    I wasn't able to reproduce the issue myself but he confirmed
    the above patch fixed the tests.

diff --git a/spec/unit/parser/functions.rb b/spec/unit/parser/functions.rb
index 8d0492d..fe44913 100644
--- a/spec/unit/parser/functions.rb
+++ b/spec/unit/parser/functions.rb
@@ -25,20 +25,20 @@ describe Puppet::Parser::Functions do
 
     describe "when calling newfunction" do
         it "should create the function in the scope class" do
-            Puppet::Parser::Scope.expects(:define_method).with("function_name", nil)
+            Puppet::Parser::Scope.expects(:define_method).with { |name,block| name == "function_name" }
 
             Puppet::Parser::Functions.newfunction("name", :type => :rvalue)
         end
 
         it "should raise an error if the function already exists" do
-            Puppet::Parser::Scope.expects(:define_method).with("function_name", nil).once
+            Puppet::Parser::Scope.expects(:define_method).with { |name,block| name == "function_name" }.once
             Puppet::Parser::Functions.newfunction("name", :type => :rvalue)
 
             lambda { Puppet::Parser::Functions.newfunction("name", :type => :rvalue) }.should raise_error
         end
 
         it "should raise an error if the function type is not correct" do
-            Puppet::Parser::Scope.expects(:define_method).with("function_name", nil).never
+            Puppet::Parser::Scope.expects(:define_method).with { |name,block| name == "function_name" }.never
 
             lambda { Puppet::Parser::Functions.newfunction("name", :type => :unknown) }.should raise_error
         end
@@ -46,7 +46,7 @@ describe Puppet::Parser::Functions do
 
     describe "when calling rmfunction" do
         it "should remove the function in the scope class" do
-            Puppet::Parser::Scope.stubs(:define_method).with("function_name", nil)
+            Puppet::Parser::Scope.expects(:define_method).with { |name,block| name == "function_name" }
             Puppet::Parser::Functions.newfunction("name", :type => :rvalue)
 
             Puppet::Parser::Scope.expects(:remove_method).with("function_name").once
@@ -68,7 +68,7 @@ describe Puppet::Parser::Functions do
         end
 
         it "should return it's name if the function exists" do
-            Puppet::Parser::Scope.stubs(:define_method).with("function_name", nil)
+            Puppet::Parser::Scope.expects(:define_method).with { |name,block| name == "function_name" }
             Puppet::Parser::Functions.newfunction("name", :type => :rvalue)
 
             Puppet::Parser::Functions.function("name").should == "function_name"

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list