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

Daniel Pittman daniel at rimspace.net
Tue May 10 08:05:44 UTC 2011


The following commit has been merged in the experimental branch:
commit 0f6faf5e138e6d11e79b2430b4e6fa6139442509
Author: Daniel Pittman <daniel at rimspace.net>
Date:   Wed Mar 2 19:06:57 2011 -0800

    (#6582) Eliminate the old fakedata helper method.
    
    This is replaced with the new my_fixture{,s} methods; old fixture data is
    ported into the spec tests at the same time, but left where it was against
    unit tests that require it.
    
    Reviewed-By: Nick Lewis <nick at puppetlabs.com>

diff --git a/test/data/providers/mailalias/aliases/test1 b/spec/fixtures/integration/provider/mailalias/aliases/test1
similarity index 100%
copy from test/data/providers/mailalias/aliases/test1
copy to spec/fixtures/integration/provider/mailalias/aliases/test1
diff --git a/test/data/snippets/aliastest.pp b/spec/fixtures/unit/parser/lexer/aliastest.pp
similarity index 100%
copy from test/data/snippets/aliastest.pp
copy to spec/fixtures/unit/parser/lexer/aliastest.pp
diff --git a/test/data/snippets/append.pp b/spec/fixtures/unit/parser/lexer/append.pp
similarity index 100%
copy from test/data/snippets/append.pp
copy to spec/fixtures/unit/parser/lexer/append.pp
diff --git a/test/data/snippets/argumentdefaults b/spec/fixtures/unit/parser/lexer/argumentdefaults.pp
similarity index 100%
copy from test/data/snippets/argumentdefaults
copy to spec/fixtures/unit/parser/lexer/argumentdefaults.pp
diff --git a/test/data/snippets/arithmetic_expression.pp b/spec/fixtures/unit/parser/lexer/arithmetic_expression.pp
similarity index 100%
copy from test/data/snippets/arithmetic_expression.pp
copy to spec/fixtures/unit/parser/lexer/arithmetic_expression.pp
diff --git a/test/data/snippets/arraytrailingcomma.pp b/spec/fixtures/unit/parser/lexer/arraytrailingcomma.pp
similarity index 100%
copy from test/data/snippets/arraytrailingcomma.pp
copy to spec/fixtures/unit/parser/lexer/arraytrailingcomma.pp
diff --git a/test/data/snippets/casestatement.pp b/spec/fixtures/unit/parser/lexer/casestatement.pp
similarity index 100%
copy from test/data/snippets/casestatement.pp
copy to spec/fixtures/unit/parser/lexer/casestatement.pp
diff --git a/test/data/snippets/classheirarchy.pp b/spec/fixtures/unit/parser/lexer/classheirarchy.pp
similarity index 100%
copy from test/data/snippets/classheirarchy.pp
copy to spec/fixtures/unit/parser/lexer/classheirarchy.pp
diff --git a/test/data/snippets/classincludes.pp b/spec/fixtures/unit/parser/lexer/classincludes.pp
similarity index 100%
copy from test/data/snippets/classincludes.pp
copy to spec/fixtures/unit/parser/lexer/classincludes.pp
diff --git a/test/data/snippets/classpathtest b/spec/fixtures/unit/parser/lexer/classpathtest.pp
similarity index 100%
copy from test/data/snippets/classpathtest
copy to spec/fixtures/unit/parser/lexer/classpathtest.pp
diff --git a/test/data/snippets/collection.pp b/spec/fixtures/unit/parser/lexer/collection.pp
similarity index 100%
copy from test/data/snippets/collection.pp
copy to spec/fixtures/unit/parser/lexer/collection.pp
diff --git a/test/data/snippets/collection_override.pp b/spec/fixtures/unit/parser/lexer/collection_override.pp
similarity index 100%
copy from test/data/snippets/collection_override.pp
copy to spec/fixtures/unit/parser/lexer/collection_override.pp
diff --git a/test/data/snippets/collection_within_virtual_definitions.pp b/spec/fixtures/unit/parser/lexer/collection_within_virtual_definitions.pp
similarity index 100%
copy from test/data/snippets/collection_within_virtual_definitions.pp
copy to spec/fixtures/unit/parser/lexer/collection_within_virtual_definitions.pp
diff --git a/test/data/snippets/componentmetaparams.pp b/spec/fixtures/unit/parser/lexer/componentmetaparams.pp
similarity index 100%
copy from test/data/snippets/componentmetaparams.pp
copy to spec/fixtures/unit/parser/lexer/componentmetaparams.pp
diff --git a/test/data/snippets/componentrequire.pp b/spec/fixtures/unit/parser/lexer/componentrequire.pp
similarity index 100%
copy from test/data/snippets/componentrequire.pp
copy to spec/fixtures/unit/parser/lexer/componentrequire.pp
diff --git a/test/data/snippets/deepclassheirarchy.pp b/spec/fixtures/unit/parser/lexer/deepclassheirarchy.pp
similarity index 100%
copy from test/data/snippets/deepclassheirarchy.pp
copy to spec/fixtures/unit/parser/lexer/deepclassheirarchy.pp
diff --git a/test/data/snippets/defineoverrides.pp b/spec/fixtures/unit/parser/lexer/defineoverrides.pp
similarity index 100%
copy from test/data/snippets/defineoverrides.pp
copy to spec/fixtures/unit/parser/lexer/defineoverrides.pp
diff --git a/test/data/snippets/emptyclass.pp b/spec/fixtures/unit/parser/lexer/emptyclass.pp
similarity index 100%
copy from test/data/snippets/emptyclass.pp
copy to spec/fixtures/unit/parser/lexer/emptyclass.pp
diff --git a/test/data/snippets/emptyexec.pp b/spec/fixtures/unit/parser/lexer/emptyexec.pp
similarity index 100%
copy from test/data/snippets/emptyexec.pp
copy to spec/fixtures/unit/parser/lexer/emptyexec.pp
diff --git a/test/data/snippets/emptyifelse.pp b/spec/fixtures/unit/parser/lexer/emptyifelse.pp
similarity index 100%
copy from test/data/snippets/emptyifelse.pp
copy to spec/fixtures/unit/parser/lexer/emptyifelse.pp
diff --git a/test/data/snippets/falsevalues.pp b/spec/fixtures/unit/parser/lexer/falsevalues.pp
similarity index 100%
copy from test/data/snippets/falsevalues.pp
copy to spec/fixtures/unit/parser/lexer/falsevalues.pp
diff --git a/test/data/snippets/filecreate b/spec/fixtures/unit/parser/lexer/filecreate.pp
similarity index 100%
copy from test/data/snippets/filecreate
copy to spec/fixtures/unit/parser/lexer/filecreate.pp
diff --git a/test/data/snippets/fqdefinition.pp b/spec/fixtures/unit/parser/lexer/fqdefinition.pp
similarity index 100%
copy from test/data/snippets/fqdefinition.pp
copy to spec/fixtures/unit/parser/lexer/fqdefinition.pp
diff --git a/test/data/snippets/fqparents.pp b/spec/fixtures/unit/parser/lexer/fqparents.pp
similarity index 100%
copy from test/data/snippets/fqparents.pp
copy to spec/fixtures/unit/parser/lexer/fqparents.pp
diff --git a/test/data/snippets/funccomma.pp b/spec/fixtures/unit/parser/lexer/funccomma.pp
similarity index 100%
copy from test/data/snippets/funccomma.pp
copy to spec/fixtures/unit/parser/lexer/funccomma.pp
diff --git a/test/data/snippets/hash.pp b/spec/fixtures/unit/parser/lexer/hash.pp
similarity index 100%
copy from test/data/snippets/hash.pp
copy to spec/fixtures/unit/parser/lexer/hash.pp
diff --git a/test/data/snippets/ifexpression.pp b/spec/fixtures/unit/parser/lexer/ifexpression.pp
similarity index 100%
copy from test/data/snippets/ifexpression.pp
copy to spec/fixtures/unit/parser/lexer/ifexpression.pp
diff --git a/test/data/snippets/implicititeration b/spec/fixtures/unit/parser/lexer/implicititeration.pp
similarity index 100%
copy from test/data/snippets/implicititeration
copy to spec/fixtures/unit/parser/lexer/implicititeration.pp
diff --git a/test/data/snippets/multilinecomments.pp b/spec/fixtures/unit/parser/lexer/multilinecomments.pp
similarity index 100%
copy from test/data/snippets/multilinecomments.pp
copy to spec/fixtures/unit/parser/lexer/multilinecomments.pp
diff --git a/test/data/snippets/multipleclass.pp b/spec/fixtures/unit/parser/lexer/multipleclass.pp
similarity index 100%
copy from test/data/snippets/multipleclass.pp
copy to spec/fixtures/unit/parser/lexer/multipleclass.pp
diff --git a/test/data/snippets/multipleinstances b/spec/fixtures/unit/parser/lexer/multipleinstances.pp
similarity index 100%
copy from test/data/snippets/multipleinstances
copy to spec/fixtures/unit/parser/lexer/multipleinstances.pp
diff --git a/test/data/snippets/multisubs.pp b/spec/fixtures/unit/parser/lexer/multisubs.pp
similarity index 100%
copy from test/data/snippets/multisubs.pp
copy to spec/fixtures/unit/parser/lexer/multisubs.pp
diff --git a/test/data/snippets/namevartest b/spec/fixtures/unit/parser/lexer/namevartest.pp
similarity index 100%
copy from test/data/snippets/namevartest
copy to spec/fixtures/unit/parser/lexer/namevartest.pp
diff --git a/test/data/snippets/scopetest b/spec/fixtures/unit/parser/lexer/scopetest.pp
similarity index 100%
copy from test/data/snippets/scopetest
copy to spec/fixtures/unit/parser/lexer/scopetest.pp
diff --git a/test/data/snippets/selectorvalues.pp b/spec/fixtures/unit/parser/lexer/selectorvalues.pp
similarity index 100%
copy from test/data/snippets/selectorvalues.pp
copy to spec/fixtures/unit/parser/lexer/selectorvalues.pp
diff --git a/test/data/snippets/simpledefaults b/spec/fixtures/unit/parser/lexer/simpledefaults.pp
similarity index 100%
copy from test/data/snippets/simpledefaults
copy to spec/fixtures/unit/parser/lexer/simpledefaults.pp
diff --git a/test/data/snippets/simpleselector b/spec/fixtures/unit/parser/lexer/simpleselector.pp
similarity index 100%
copy from test/data/snippets/simpleselector
copy to spec/fixtures/unit/parser/lexer/simpleselector.pp
diff --git a/test/data/snippets/singleary.pp b/spec/fixtures/unit/parser/lexer/singleary.pp
similarity index 100%
copy from test/data/snippets/singleary.pp
copy to spec/fixtures/unit/parser/lexer/singleary.pp
diff --git a/test/data/snippets/singlequote.pp b/spec/fixtures/unit/parser/lexer/singlequote.pp
similarity index 100%
copy from test/data/snippets/singlequote.pp
copy to spec/fixtures/unit/parser/lexer/singlequote.pp
diff --git a/test/data/snippets/singleselector.pp b/spec/fixtures/unit/parser/lexer/singleselector.pp
similarity index 100%
copy from test/data/snippets/singleselector.pp
copy to spec/fixtures/unit/parser/lexer/singleselector.pp
diff --git a/test/data/snippets/subclass_name_duplication.pp b/spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp
similarity index 100%
copy from test/data/snippets/subclass_name_duplication.pp
copy to spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp
diff --git a/test/data/snippets/tag.pp b/spec/fixtures/unit/parser/lexer/tag.pp
similarity index 100%
copy from test/data/snippets/tag.pp
copy to spec/fixtures/unit/parser/lexer/tag.pp
diff --git a/test/data/snippets/tagged.pp b/spec/fixtures/unit/parser/lexer/tagged.pp
similarity index 100%
copy from test/data/snippets/tagged.pp
copy to spec/fixtures/unit/parser/lexer/tagged.pp
diff --git a/test/data/snippets/virtualresources.pp b/spec/fixtures/unit/parser/lexer/virtualresources.pp
similarity index 100%
copy from test/data/snippets/virtualresources.pp
copy to spec/fixtures/unit/parser/lexer/virtualresources.pp
diff --git a/test/data/providers/host/parsed/valid_hosts b/spec/fixtures/unit/provider/host/parsed/valid_hosts
similarity index 100%
copy from test/data/providers/host/parsed/valid_hosts
copy to spec/fixtures/unit/provider/host/parsed/valid_hosts
diff --git a/test/data/types/mount/freebsd.fstab b/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab
similarity index 100%
copy from test/data/types/mount/freebsd.fstab
copy to spec/fixtures/unit/provider/mount/parsed/freebsd.fstab
diff --git a/test/data/types/mount/linux.fstab b/spec/fixtures/unit/provider/mount/parsed/linux.fstab
similarity index 100%
copy from test/data/types/mount/linux.fstab
copy to spec/fixtures/unit/provider/mount/parsed/linux.fstab
diff --git a/test/data/types/mount/solaris.fstab b/spec/fixtures/unit/provider/mount/parsed/solaris.fstab
similarity index 100%
copy from test/data/types/mount/solaris.fstab
copy to spec/fixtures/unit/provider/mount/parsed/solaris.fstab
diff --git a/test/data/providers/ssh_authorized_key/parsed/authorized_keys b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys
similarity index 100%
copy from test/data/providers/ssh_authorized_key/parsed/authorized_keys
copy to spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys
diff --git a/test/data/providers/ssh_authorized_key/parsed/authorized_keys1 b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys1
similarity index 100%
copy from test/data/providers/ssh_authorized_key/parsed/authorized_keys1
copy to spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys1
diff --git a/test/data/providers/ssh_authorized_key/parsed/authorized_keys2 b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys2
similarity index 100%
copy from test/data/providers/ssh_authorized_key/parsed/authorized_keys2
copy to spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys2
diff --git a/test/data/reports/tagmail_failers.conf b/spec/fixtures/unit/reports/tagmail/tagmail_failers.conf
similarity index 100%
copy from test/data/reports/tagmail_failers.conf
copy to spec/fixtures/unit/reports/tagmail/tagmail_failers.conf
diff --git a/test/data/reports/tagmail_passers.conf b/spec/fixtures/unit/reports/tagmail/tagmail_passers.conf
similarity index 100%
copy from test/data/reports/tagmail_passers.conf
copy to spec/fixtures/unit/reports/tagmail/tagmail_passers.conf
diff --git a/spec/integration/provider/mailalias/aliases_spec.rb b/spec/integration/provider/mailalias/aliases_spec.rb
index bce9374..c9c2526 100755
--- a/spec/integration/provider/mailalias/aliases_spec.rb
+++ b/spec/integration/provider/mailalias/aliases_spec.rb
@@ -2,14 +2,12 @@
 
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
-require 'puppettest/support/utils'
 require 'puppettest/fileparsing'
 
 provider_class = Puppet::Type.type(:mailalias).provider(:aliases)
 
 describe provider_class do
   include PuppetTest::FileParsing
-  include PuppetTest::Support::Utils
 
   before :each do
     @provider = provider_class
@@ -17,8 +15,8 @@ describe provider_class do
 
   # #1560
   it "should be able to parse the mailalias examples" do
-    fakedata("data/providers/mailalias/aliases").each { |file|
+    my_fixtures do |file|
       fakedataparse(file)
-    }
+    end
   end
 end
diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb
index 58978ff..b8254f2 100755
--- a/spec/unit/parser/lexer_spec.rb
+++ b/spec/unit/parser/lexer_spec.rb
@@ -651,11 +651,8 @@ describe "Puppet::Parser::Lexer in the old tests" do
   end
 end
 
-require File.dirname(__FILE__) + '/../../../test/lib/puppettest'
-require File.dirname(__FILE__) + '/../../../test/lib/puppettest/support/utils'
 describe "Puppet::Parser::Lexer in the old tests when lexing example files" do
-  extend PuppetTest::Support::Utils
-  textfiles do |file|
+  my_fixtures('*.pp') do |file|
     it "should correctly lex #{file}" do
       lexer = Puppet::Parser::Lexer.new
       lexer.file = file
diff --git a/spec/unit/provider/host/parsed_spec.rb b/spec/unit/provider/host/parsed_spec.rb
old mode 100644
new mode 100755
index 5704304..4a616f3
--- a/spec/unit/provider/host/parsed_spec.rb
+++ b/spec/unit/provider/host/parsed_spec.rb
@@ -3,14 +3,12 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet_spec/files'
-require 'puppettest/support/utils'
 require 'puppettest/fileparsing'
 
 provider_class = Puppet::Type.type(:host).provider(:parsed)
 
 describe provider_class do
   include PuppetSpec::Files
-  extend  PuppetTest::Support::Utils
   include PuppetTest::FileParsing
 
   before do
@@ -132,7 +130,7 @@ describe provider_class do
   end
 
   describe "when operating on /etc/hosts like files" do
-    fakedata("data/providers/host/parsed","valid*").each do |file|
+    my_fixtures('valid*') do |file|
       it "should be able to parse #{file}" do
        fakedataparse(file)
       end
diff --git a/spec/unit/provider/mount/parsed_spec.rb b/spec/unit/provider/mount/parsed_spec.rb
index fc4df97..0eb4739 100755
--- a/spec/unit/provider/mount/parsed_spec.rb
+++ b/spec/unit/provider/mount/parsed_spec.rb
@@ -5,11 +5,9 @@
 
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
-require 'puppettest/support/utils'
 require 'puppettest/fileparsing'
 
 module ParsedMountTesting
-  include PuppetTest::Support::Utils
   include PuppetTest::FileParsing
 
   def fake_fstab
@@ -23,7 +21,7 @@ module ParsedMountTesting
       name = "linux.fstab"
     end
     oldpath = @provider_class.default_target
-    fakefile(File::join("data/types/mount", name))
+    my_fixture(name)
   end
 
   def mkmountargs
diff --git a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
index fb4c649..b951b0a 100755
--- a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
+++ b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
@@ -3,7 +3,6 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet_spec/files'
-require 'puppettest/support/utils'
 require 'puppettest/fileparsing'
 require 'puppettest/fakes'
 
@@ -11,7 +10,6 @@ provider_class = Puppet::Type.type(:ssh_authorized_key).provider(:parsed)
 
 describe provider_class do
   include PuppetSpec::Files
-  extend PuppetTest::Support::Utils
   include PuppetTest
   include PuppetTest::FileParsing
 
@@ -50,11 +48,11 @@ describe provider_class do
     @provider.target_object(@keyfile).read
   end
 
-  fakedata("data/providers/ssh_authorized_key/parsed").each { |file|
+  my_fixtures do |file|
     it "should be able to parse example data in #{file}" do
       fakedataparse(file)
     end
-  }
+  end
 
   it "should be able to generate a basic authorized_keys file" do
 
diff --git a/spec/unit/reports/tagmail_spec.rb b/spec/unit/reports/tagmail_spec.rb
index 1dadfc7..fa8990e 100755
--- a/spec/unit/reports/tagmail_spec.rb
+++ b/spec/unit/reports/tagmail_spec.rb
@@ -3,26 +3,23 @@
 Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
 
 require 'puppet/reports'
-require 'puppettest/support/utils'
 
 tagmail = Puppet::Reports.report(:tagmail)
 
 describe tagmail do
-  extend PuppetTest::Support::Utils
-
   before do
     @processor = Puppet::Transaction::Report.new("apply")
     @processor.extend(Puppet::Reports.report(:tagmail))
   end
 
-  passers = File.join(datadir, "reports", "tagmail_passers.conf")
+  passers = my_fixture "tagmail_passers.conf"
   File.readlines(passers).each do |line|
     it "should be able to parse '#{line.inspect}'" do
       @processor.parse(line)
     end
   end
 
-  failers = File.join(datadir, "reports", "tagmail_failers.conf")
+  failers = my_fixture "tagmail_failers.conf"
   File.readlines(failers).each do |line|
     it "should not be able to parse '#{line.inspect}'" do
       lambda { @processor.parse(line) }.should raise_error(ArgumentError)
diff --git a/spec/unit/type/file_spec.rb b/spec/unit/type/file_spec.rb
index 539782f..b15d41d 100755
--- a/spec/unit/type/file_spec.rb
+++ b/spec/unit/type/file_spec.rb
@@ -379,8 +379,6 @@ describe Puppet::Type.type(:file) do
   end
 
   describe "when managing links" do
-    require 'puppettest/support/assertions'
-    include PuppetTest
     require 'tempfile'
 
     if @real_posix
@@ -394,13 +392,7 @@ describe Puppet::Type.type(:file) do
           File.open(@file, "w", 0644) { |f| f.puts "yayness"; f.flush }
           File.symlink(@file, @link)
 
-
-                @resource = Puppet::Type.type(:file).new(
-
-            :path => @link,
-
-            :mode => "755"
-          )
+          @resource = Puppet::Type.type(:file).new(:path => @link, :mode => "755")
           @catalog.add_resource @resource
         end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list