[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:06:13 UTC 2011


The following commit has been merged in the experimental branch:
commit f4401d34c106654d8af1f774d0b0bba27c5d4445
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Wed Mar 16 14:25:10 2011 -0700

    (#6722) load all functions before testing...
    
    We historically had a state-dependency across tests in the parser function
    support area; the first test caused the function to be loaded, and other tests
    would then fail as a consequence of that.
    
    We now autoload all functions at the top of each test suite, allowing us to
    correctly and sensibly test on them as we should.
    
    This theoretically prevents us from testing the autoloader implicitly in these
    tests, but that should be tested independently.
    
    Paired-With: Nick Lewis <nick at puppetlabs.com>

diff --git a/spec/unit/parser/functions/defined_spec.rb b/spec/unit/parser/functions/defined_spec.rb
index 0dd1dad..0113c32 100755
--- a/spec/unit/parser/functions/defined_spec.rb
+++ b/spec/unit/parser/functions/defined_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the 'defined' function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     Puppet::Node::Environment.stubs(:current).returns(nil)
diff --git a/spec/unit/parser/functions/extlookup_spec.rb b/spec/unit/parser/functions/extlookup_spec.rb
index a476dc8..46cd3cc 100755
--- a/spec/unit/parser/functions/extlookup_spec.rb
+++ b/spec/unit/parser/functions/extlookup_spec.rb
@@ -4,12 +4,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 require 'tempfile'
 
 describe "the extlookup function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
-
     @scope.stubs(:environment).returns(Puppet::Node::Environment.new('production'))
-    Puppet::Parser::Functions.function("extlookup")
   end
 
   it "should exist" do
diff --git a/spec/unit/parser/functions/fqdn_rand_spec.rb b/spec/unit/parser/functions/fqdn_rand_spec.rb
old mode 100644
new mode 100755
index 151ebac..be2e6fa
--- a/spec/unit/parser/functions/fqdn_rand_spec.rb
+++ b/spec/unit/parser/functions/fqdn_rand_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the fqdn_rand function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
diff --git a/spec/unit/parser/functions/generate_spec.rb b/spec/unit/parser/functions/generate_spec.rb
index 12f4542..d25015b 100755
--- a/spec/unit/parser/functions/generate_spec.rb
+++ b/spec/unit/parser/functions/generate_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the generate function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
diff --git a/spec/unit/parser/functions/include_spec.rb b/spec/unit/parser/functions/include_spec.rb
old mode 100644
new mode 100755
index 67227e7..cfaadfb
--- a/spec/unit/parser/functions/include_spec.rb
+++ b/spec/unit/parser/functions/include_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the 'include' function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     Puppet::Node::Environment.stubs(:current).returns(nil)
diff --git a/spec/unit/parser/functions/inline_template_spec.rb b/spec/unit/parser/functions/inline_template_spec.rb
index 36d5377..712c68c 100755
--- a/spec/unit/parser/functions/inline_template_spec.rb
+++ b/spec/unit/parser/functions/inline_template_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the inline_template function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
@@ -56,4 +59,4 @@ describe "the inline_template function" do
     lambda { @scope.function_inline_template("1") }.should raise_error(Puppet::ParseError)
   end
 
-end
\ No newline at end of file
+end
diff --git a/spec/unit/parser/functions/realize_spec.rb b/spec/unit/parser/functions/realize_spec.rb
index 899f69b..3106c42 100755
--- a/spec/unit/parser/functions/realize_spec.rb
+++ b/spec/unit/parser/functions/realize_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the realize function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @collector = stub_everything 'collector'
diff --git a/spec/unit/parser/functions/regsubst_spec.rb b/spec/unit/parser/functions/regsubst_spec.rb
index 09aa92d..1fb8e41 100755
--- a/spec/unit/parser/functions/regsubst_spec.rb
+++ b/spec/unit/parser/functions/regsubst_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the regsubst function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
diff --git a/spec/unit/parser/functions/require_spec.rb b/spec/unit/parser/functions/require_spec.rb
index 4afbd5a..edcbc4a 100755
--- a/spec/unit/parser/functions/require_spec.rb
+++ b/spec/unit/parser/functions/require_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the require function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @catalog = stub 'catalog'
diff --git a/spec/unit/parser/functions/shellquote_spec.rb b/spec/unit/parser/functions/shellquote_spec.rb
index c8b0d65..55302b9 100755
--- a/spec/unit/parser/functions/shellquote_spec.rb
+++ b/spec/unit/parser/functions/shellquote_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the shellquote function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
diff --git a/spec/unit/parser/functions/split_spec.rb b/spec/unit/parser/functions/split_spec.rb
index 3971000..b892a5c 100755
--- a/spec/unit/parser/functions/split_spec.rb
+++ b/spec/unit/parser/functions/split_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the split function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
diff --git a/spec/unit/parser/functions/sprintf_spec.rb b/spec/unit/parser/functions/sprintf_spec.rb
index 4f29012..69fbb5e 100755
--- a/spec/unit/parser/functions/sprintf_spec.rb
+++ b/spec/unit/parser/functions/sprintf_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the sprintf function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
diff --git a/spec/unit/parser/functions/tag_spec.rb b/spec/unit/parser/functions/tag_spec.rb
index e9b5122..b6bb452 100755
--- a/spec/unit/parser/functions/tag_spec.rb
+++ b/spec/unit/parser/functions/tag_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the 'tag' function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
diff --git a/spec/unit/parser/functions/template_spec.rb b/spec/unit/parser/functions/template_spec.rb
index 9dd5cc9..7eaf355 100755
--- a/spec/unit/parser/functions/template_spec.rb
+++ b/spec/unit/parser/functions/template_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the template function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new
@@ -59,4 +62,4 @@ describe "the template function" do
     lambda { @scope.function_template("1") }.should raise_error(Puppet::ParseError)
   end
 
-end
\ No newline at end of file
+end
diff --git a/spec/unit/parser/functions/versioncmp_spec.rb b/spec/unit/parser/functions/versioncmp_spec.rb
index 2bc7be8..ddc79cd 100755
--- a/spec/unit/parser/functions/versioncmp_spec.rb
+++ b/spec/unit/parser/functions/versioncmp_spec.rb
@@ -3,6 +3,9 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe "the versioncmp function" do
+  before :all do
+    Puppet::Parser::Functions.autoloader.loadall
+  end
 
   before :each do
     @scope = Puppet::Parser::Scope.new

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list