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

Matt Robinson matt at puppetlabs.com
Tue May 10 08:06:49 UTC 2011


The following commit has been merged in the experimental branch:
commit f6da3339f59bbd9243a03dc1e417b1fed7955c7e
Author: Matt Robinson <matt at puppetlabs.com>
Date:   Tue Mar 22 11:31:14 2011 -0700

    maint: Change code for finding spec_helper to work with Ruby 1.9
    
    Running the specs under Ruby 1.9 didn't work using the lambda to recurse
    down directories to find the spec_helper.  Standardizing the way to find
    spec_helper like the rest of specs seemed like the way to go.
    
    Here's the command line perl I used to make the change:
    
    perl -p -i -e "s/Dir.chdir.*lambda.*spec_helper.*$/require
    File.expand_path(File.dirname(__FILE__) + '\/..\/..\/spec_helper')/"
    `find spec -name "*_spec.rb"`
    
    Then I fixed the number of dots for files that weren't two levels from
    the spec dir and whose tests failed.
    
    Reviewed-by: Nick Lewis <nick at puppetlabs.com>

diff --git a/spec/integration/indirector/catalog/compiler_spec.rb b/spec/integration/indirector/catalog/compiler_spec.rb
index dcb7eb4..1146c20 100755
--- a/spec/integration/indirector/catalog/compiler_spec.rb
+++ b/spec/integration/indirector/catalog/compiler_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet/resource/catalog'
 
diff --git a/spec/integration/indirector/catalog/queue_spec.rb b/spec/integration/indirector/catalog/queue_spec.rb
index 4581e30..237e489 100755
--- a/spec/integration/indirector/catalog/queue_spec.rb
+++ b/spec/integration/indirector/catalog/queue_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet/resource/catalog'
 
diff --git a/spec/integration/provider/package_spec.rb b/spec/integration/provider/package_spec.rb
index 472662d..cc03c57 100755
--- a/spec/integration/provider/package_spec.rb
+++ b/spec/integration/provider/package_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 describe "Package Provider" do
   Puppet::Type.type(:package).providers.each do |name|
diff --git a/spec/integration/provider/service/init_spec.rb b/spec/integration/provider/service/init_spec.rb
index 2e2505b..c74ce29 100755
--- a/spec/integration/provider/service/init_spec.rb
+++ b/spec/integration/provider/service/init_spec.rb
@@ -1,7 +1,6 @@
 #!/usr/bin/env ruby
 
-# Find and load the spec file.
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 provider = Puppet::Type.type(:service).provider(:init)
 
diff --git a/spec/integration/reference/providers_spec.rb b/spec/integration/reference/providers_spec.rb
index c2b1e17..d6e19cb 100755
--- a/spec/integration/reference/providers_spec.rb
+++ b/spec/integration/reference/providers_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/reference'
 
diff --git a/spec/integration/util/autoload_spec.rb b/spec/integration/util/autoload_spec.rb
index 8a5d662..f9b9135 100755
--- a/spec/integration/util/autoload_spec.rb
+++ b/spec/integration/util/autoload_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/autoload'
 require 'fileutils'
diff --git a/spec/integration/util/feature_spec.rb b/spec/integration/util/feature_spec.rb
index f1ada90..b038cf3 100755
--- a/spec/integration/util/feature_spec.rb
+++ b/spec/integration/util/feature_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/feature'
 require 'puppet_spec/files'
diff --git a/spec/integration/util/file_locking_spec.rb b/spec/integration/util/file_locking_spec.rb
index 5061344..1914fad 100755
--- a/spec/integration/util/file_locking_spec.rb
+++ b/spec/integration/util/file_locking_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/file_locking'
 
diff --git a/spec/integration/util/rdoc/parser_spec.rb b/spec/integration/util/rdoc/parser_spec.rb
index 7d3b0ec..9cb0c9e 100755
--- a/spec/integration/util/rdoc/parser_spec.rb
+++ b/spec/integration/util/rdoc/parser_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet/resource/type_collection'
 require 'puppet/util/rdoc/parser'
diff --git a/spec/unit/indirector/file_bucket_file/rest_spec.rb b/spec/unit/indirector/file_bucket_file/rest_spec.rb
index 960f60a..d0f7147 100755
--- a/spec/unit/indirector/file_bucket_file/rest_spec.rb
+++ b/spec/unit/indirector/file_bucket_file/rest_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet/indirector/file_bucket_file/rest'
 
diff --git a/spec/unit/indirector/resource/rest_spec.rb b/spec/unit/indirector/resource/rest_spec.rb
index 351aee3..1285d33 100755
--- a/spec/unit/indirector/resource/rest_spec.rb
+++ b/spec/unit/indirector/resource/rest_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet/indirector/resource/rest'
 
diff --git a/spec/unit/indirector/status/rest_spec.rb b/spec/unit/indirector/status/rest_spec.rb
index 5eed5fc..436c868 100755
--- a/spec/unit/indirector/status/rest_spec.rb
+++ b/spec/unit/indirector/status/rest_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet/indirector/status/rest'
 
diff --git a/spec/unit/network/http/api/v1_spec.rb b/spec/unit/network/http/api/v1_spec.rb
index 25f6d8f..257eec5 100644
--- a/spec/unit/network/http/api/v1_spec.rb
+++ b/spec/unit/network/http/api/v1_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../../spec_helper')
 
 require 'puppet/network/http/api/v1'
 
diff --git a/spec/unit/network/xmlrpc/client_spec.rb b/spec/unit/network/xmlrpc/client_spec.rb
index 8440d39..7498ca4 100755
--- a/spec/unit/network/xmlrpc/client_spec.rb
+++ b/spec/unit/network/xmlrpc/client_spec.rb
@@ -1,7 +1,7 @@
 #!/usr/bin/env ruby
 require 'puppet/network/client'
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe Puppet::Network::XMLRPCClient do
   describe "when performing the rpc call" do
diff --git a/spec/unit/property/ensure_spec.rb b/spec/unit/property/ensure_spec.rb
index f2722de..d3029c6 100644
--- a/spec/unit/property/ensure_spec.rb
+++ b/spec/unit/property/ensure_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/property/ensure'
 
diff --git a/spec/unit/property/keyvalue_spec.rb b/spec/unit/property/keyvalue_spec.rb
index a44d891..a0175cf 100644
--- a/spec/unit/property/keyvalue_spec.rb
+++ b/spec/unit/property/keyvalue_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/property/keyvalue'
 
diff --git a/spec/unit/property/list_spec.rb b/spec/unit/property/list_spec.rb
index c6c5db1..704fbe3 100644
--- a/spec/unit/property/list_spec.rb
+++ b/spec/unit/property/list_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/property/list'
 
diff --git a/spec/unit/property/ordered_list_spec.rb b/spec/unit/property/ordered_list_spec.rb
index 7c8eceb..460bec7 100644
--- a/spec/unit/property/ordered_list_spec.rb
+++ b/spec/unit/property/ordered_list_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/property/ordered_list'
 
diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb
index 3c6bf62..b0ce4f7 100755
--- a/spec/unit/provider/package/apt_spec.rb
+++ b/spec/unit/provider/package/apt_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 provider = Puppet::Type.type(:package).provider(:apt)
 
diff --git a/spec/unit/provider/package/dpkg_spec.rb b/spec/unit/provider/package/dpkg_spec.rb
index 47ac976..444fb31 100755
--- a/spec/unit/provider/package/dpkg_spec.rb
+++ b/spec/unit/provider/package/dpkg_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 provider = Puppet::Type.type(:package).provider(:dpkg)
 
diff --git a/spec/unit/provider/package/pkg_spec.rb b/spec/unit/provider/package/pkg_spec.rb
index 1544b8b..3455c4c 100644
--- a/spec/unit/provider/package/pkg_spec.rb
+++ b/spec/unit/provider/package/pkg_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 provider = Puppet::Type.type(:package).provider(:pkg)
 
diff --git a/spec/unit/provider/package/pkgdmg_spec.rb b/spec/unit/provider/package/pkgdmg_spec.rb
index 1fd5b4a..86631e5 100755
--- a/spec/unit/provider/package/pkgdmg_spec.rb
+++ b/spec/unit/provider/package/pkgdmg_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 provider = Puppet::Type.type(:package).provider(:pkgdmg)
 
diff --git a/spec/unit/provider/selboolean_spec.rb b/spec/unit/provider/selboolean_spec.rb
index b37b44b..02a39f2 100755
--- a/spec/unit/provider/selboolean_spec.rb
+++ b/spec/unit/provider/selboolean_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 provider_class = Puppet::Type.type(:selboolean).provider(:getsetsebool)
 
diff --git a/spec/unit/provider/selmodule_spec.rb b/spec/unit/provider/selmodule_spec.rb
index fda6d0d..cb143e9 100755
--- a/spec/unit/provider/selmodule_spec.rb
+++ b/spec/unit/provider/selmodule_spec.rb
@@ -5,7 +5,7 @@
 # with version 1.5.0.  The provided selmodule-example.pp is the first
 # 256 bytes taken from /usr/share/selinux/targeted/nagios.pp on Fedora 9
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 provider_class = Puppet::Type.type(:selmodule).provider(:semodule)
 
diff --git a/spec/unit/reports/http_spec.rb b/spec/unit/reports/http_spec.rb
index 70742f7..a62793e 100644
--- a/spec/unit/reports/http_spec.rb
+++ b/spec/unit/reports/http_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/reports'
 
diff --git a/spec/unit/reports/rrdgraph_spec.rb b/spec/unit/reports/rrdgraph_spec.rb
index ce2cf79..5215f1d 100644
--- a/spec/unit/reports/rrdgraph_spec.rb
+++ b/spec/unit/reports/rrdgraph_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/reports'
 
diff --git a/spec/unit/reports/store_spec.rb b/spec/unit/reports/store_spec.rb
index 9d90423..d48f6a8 100644
--- a/spec/unit/reports/store_spec.rb
+++ b/spec/unit/reports/store_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/reports'
 require 'time'
diff --git a/spec/unit/reports/tagmail_spec.rb b/spec/unit/reports/tagmail_spec.rb
index fa8990e..716bcbc 100755
--- a/spec/unit/reports/tagmail_spec.rb
+++ b/spec/unit/reports/tagmail_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/reports'
 
diff --git a/spec/unit/type/cron_spec.rb b/spec/unit/type/cron_spec.rb
index 03817d2..4d224c6 100755
--- a/spec/unit/type/cron_spec.rb
+++ b/spec/unit/type/cron_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 describe Puppet::Type.type(:cron) do
   before do
diff --git a/spec/unit/type/file/checksum_spec.rb b/spec/unit/type/file/checksum_spec.rb
index 8b9138b..16e8e99 100644
--- a/spec/unit/type/file/checksum_spec.rb
+++ b/spec/unit/type/file/checksum_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 checksum = Puppet::Type.type(:file).attrclass(:checksum)
 describe checksum do
diff --git a/spec/unit/type/file/content_spec.rb b/spec/unit/type/file/content_spec.rb
index bd2b2ad..7abc7c4 100755
--- a/spec/unit/type/file/content_spec.rb
+++ b/spec/unit/type/file/content_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 content = Puppet::Type.type(:file).attrclass(:content)
 describe content do
diff --git a/spec/unit/type/file/ctime.rb b/spec/unit/type/file/ctime.rb
index 6145cbf..9fb892a 100644
--- a/spec/unit/type/file/ctime.rb
+++ b/spec/unit/type/file/ctime.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe Puppet::Type.type(:file).attrclass(:ctime) do
   require 'puppet_spec/files'
diff --git a/spec/unit/type/file/ensure_spec.rb b/spec/unit/type/file/ensure_spec.rb
index dbb3a10..c535130 100755
--- a/spec/unit/type/file/ensure_spec.rb
+++ b/spec/unit/type/file/ensure_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 property = Puppet::Type.type(:file).attrclass(:ensure)
 
diff --git a/spec/unit/type/file/group_spec.rb b/spec/unit/type/file/group_spec.rb
index 956cd57..37a6872 100755
--- a/spec/unit/type/file/group_spec.rb
+++ b/spec/unit/type/file/group_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 property = Puppet::Type.type(:file).attrclass(:group)
 
diff --git a/spec/unit/type/file/mtime.rb b/spec/unit/type/file/mtime.rb
index 043156c..fa61bc3 100644
--- a/spec/unit/type/file/mtime.rb
+++ b/spec/unit/type/file/mtime.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe Puppet::Type.type(:file).attrclass(:mtime) do
   require 'puppet_spec/files'
diff --git a/spec/unit/type/file/owner_spec.rb b/spec/unit/type/file/owner_spec.rb
index bcb8e07..375faa2 100755
--- a/spec/unit/type/file/owner_spec.rb
+++ b/spec/unit/type/file/owner_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 property = Puppet::Type.type(:file).attrclass(:owner)
 
diff --git a/spec/unit/type/file/selinux_spec.rb b/spec/unit/type/file/selinux_spec.rb
index a2444ac..45e8b3b 100644
--- a/spec/unit/type/file/selinux_spec.rb
+++ b/spec/unit/type/file/selinux_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 
 [:seluser, :selrole, :seltype, :selrange].each do |param|
diff --git a/spec/unit/type/file/source_spec.rb b/spec/unit/type/file/source_spec.rb
index c07963a..bb83e75 100755
--- a/spec/unit/type/file/source_spec.rb
+++ b/spec/unit/type/file/source_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 source = Puppet::Type.type(:file).attrclass(:source)
 describe Puppet::Type.type(:file).attrclass(:source) do
diff --git a/spec/unit/type/file/type.rb b/spec/unit/type/file/type.rb
index e46f0e0..0d38b64 100644
--- a/spec/unit/type/file/type.rb
+++ b/spec/unit/type/file/type.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 describe Puppet::Type.type(:file).attrclass(:type) do
   require 'puppet_spec/files'
diff --git a/spec/unit/type/maillist_spec.rb b/spec/unit/type/maillist_spec.rb
index 04acea7..7e96b47 100755
--- a/spec/unit/type/maillist_spec.rb
+++ b/spec/unit/type/maillist_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 maillist = Puppet::Type.type(:maillist)
 
diff --git a/spec/unit/type/selboolean_spec.rb b/spec/unit/type/selboolean_spec.rb
index 3b31f43..41b254f 100755
--- a/spec/unit/type/selboolean_spec.rb
+++ b/spec/unit/type/selboolean_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 describe Puppet::Type.type(:selboolean), "when validating attributes" do
   [:name, :persistent].each do |param|
diff --git a/spec/unit/type/selmodule_spec.rb b/spec/unit/type/selmodule_spec.rb
index 3d12625..37453d8 100755
--- a/spec/unit/type/selmodule_spec.rb
+++ b/spec/unit/type/selmodule_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 describe Puppet::Type.type(:selmodule), "when validating attributes" do
   [:name, :selmoduledir, :selmodulepath].each do |param|
diff --git a/spec/unit/type/zfs_spec.rb b/spec/unit/type/zfs_spec.rb
index 6b0b17f..88193fc 100755
--- a/spec/unit/type/zfs_spec.rb
+++ b/spec/unit/type/zfs_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 zfs = Puppet::Type.type(:zfs)
 
diff --git a/spec/unit/type/zone_spec.rb b/spec/unit/type/zone_spec.rb
index a3e748b..e479fb1 100755
--- a/spec/unit/type/zone_spec.rb
+++ b/spec/unit/type/zone_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 zone = Puppet::Type.type(:zone)
 
diff --git a/spec/unit/type/zpool_spec.rb b/spec/unit/type/zpool_spec.rb
index be8cb12..96e7d54 100755
--- a/spec/unit/type/zpool_spec.rb
+++ b/spec/unit/type/zpool_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 zpool = Puppet::Type.type(:zpool)
 
diff --git a/spec/unit/util/autoload_spec.rb b/spec/unit/util/autoload_spec.rb
index eb0b705..808885d 100755
--- a/spec/unit/util/autoload_spec.rb
+++ b/spec/unit/util/autoload_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/autoload'
 
diff --git a/spec/unit/util/command_line_spec.rb b/spec/unit/util/command_line_spec.rb
index 98ddb92..a7d261d 100755
--- a/spec/unit/util/command_line_spec.rb
+++ b/spec/unit/util/command_line_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 
 require 'puppet/util/command_line'
diff --git a/spec/unit/util/errors_spec.rb b/spec/unit/util/errors_spec.rb
index 2500403..da1b8b0 100755
--- a/spec/unit/util/errors_spec.rb
+++ b/spec/unit/util/errors_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/errors'
 
diff --git a/spec/unit/util/feature_spec.rb b/spec/unit/util/feature_spec.rb
index 8cedade..3654287 100755
--- a/spec/unit/util/feature_spec.rb
+++ b/spec/unit/util/feature_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/feature'
 
diff --git a/spec/unit/util/file_locking_spec.rb b/spec/unit/util/file_locking_spec.rb
index 8fafb1d..e9dbe9d 100755
--- a/spec/unit/util/file_locking_spec.rb
+++ b/spec/unit/util/file_locking_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/file_locking'
 
diff --git a/spec/unit/util/filetype_spec.rb b/spec/unit/util/filetype_spec.rb
index 68ef9d6..012631b 100644
--- a/spec/unit/util/filetype_spec.rb
+++ b/spec/unit/util/filetype_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/filetype'
 
diff --git a/spec/unit/util/inline_docs_spec.rb b/spec/unit/util/inline_docs_spec.rb
index edfa405..75afb57 100755
--- a/spec/unit/util/inline_docs_spec.rb
+++ b/spec/unit/util/inline_docs_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/inline_docs'
 
diff --git a/spec/unit/util/log_spec.rb b/spec/unit/util/log_spec.rb
index 29df078..3c85774 100755
--- a/spec/unit/util/log_spec.rb
+++ b/spec/unit/util/log_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/log'
 
diff --git a/spec/unit/util/logging_spec.rb b/spec/unit/util/logging_spec.rb
index 411cd17..97ffc0b 100755
--- a/spec/unit/util/logging_spec.rb
+++ b/spec/unit/util/logging_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/logging'
 
diff --git a/spec/unit/util/metric_spec.rb b/spec/unit/util/metric_spec.rb
index 600b88f..4258122 100755
--- a/spec/unit/util/metric_spec.rb
+++ b/spec/unit/util/metric_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/metric'
 
diff --git a/spec/unit/util/monkey_patches_spec.rb b/spec/unit/util/monkey_patches_spec.rb
index 049ed10..8bfcd90 100644
--- a/spec/unit/util/monkey_patches_spec.rb
+++ b/spec/unit/util/monkey_patches_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/monkey_patches'
 
diff --git a/spec/unit/util/posix_spec.rb b/spec/unit/util/posix_spec.rb
index dbc90d9..6d73512 100755
--- a/spec/unit/util/posix_spec.rb
+++ b/spec/unit/util/posix_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/posix'
 
diff --git a/spec/unit/util/pson_spec.rb b/spec/unit/util/pson_spec.rb
index 474ddaf..08758ee 100755
--- a/spec/unit/util/pson_spec.rb
+++ b/spec/unit/util/pson_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/pson'
 
diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb
index 8545def..ab54c8c 100755
--- a/spec/unit/util/rdoc/parser_spec.rb
+++ b/spec/unit/util/rdoc/parser_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
 
 require 'puppet/resource/type_collection'
 require 'puppet/util/rdoc/parser'
diff --git a/spec/unit/util/rdoc_spec.rb b/spec/unit/util/rdoc_spec.rb
index 93c4f9b..3b52485 100755
--- a/spec/unit/util/rdoc_spec.rb
+++ b/spec/unit/util/rdoc_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/rdoc'
 require 'rdoc/rdoc'
diff --git a/spec/unit/util/user_attr_spec.rb b/spec/unit/util/user_attr_spec.rb
index 61312ef..5acdaee 100644
--- a/spec/unit/util/user_attr_spec.rb
+++ b/spec/unit/util/user_attr_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/user_attr'
 
diff --git a/spec/unit/util/zaml_spec.rb b/spec/unit/util/zaml_spec.rb
index 358c6aa..804aa8e 100755
--- a/spec/unit/util/zaml_spec.rb
+++ b/spec/unit/util/zaml_spec.rb
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 require 'puppet/util/monkey_patches'
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list