diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2011-03-22 11:31:14 -0700 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2011-03-22 11:39:24 -0700 |
| commit | f6da3339f59bbd9243a03dc1e417b1fed7955c7e (patch) | |
| tree | cc264fef5811c7d5e8000bc4048bab86b87064a0 /spec/unit/util | |
| parent | 307df20d7dfd4f5a2a3b67fc2587491560ee951c (diff) | |
| download | puppet-f6da3339f59bbd9243a03dc1e417b1fed7955c7e.tar.gz puppet-f6da3339f59bbd9243a03dc1e417b1fed7955c7e.tar.xz puppet-f6da3339f59bbd9243a03dc1e417b1fed7955c7e.zip | |
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@puppetlabs.com>
Diffstat (limited to 'spec/unit/util')
| -rwxr-xr-x | spec/unit/util/autoload_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/command_line_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/errors_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/feature_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/file_locking_spec.rb | 2 | ||||
| -rw-r--r-- | spec/unit/util/filetype_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/inline_docs_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/log_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/logging_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/metric_spec.rb | 2 | ||||
| -rw-r--r-- | spec/unit/util/monkey_patches_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/posix_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/pson_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/rdoc/parser_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/rdoc_spec.rb | 2 | ||||
| -rw-r--r-- | spec/unit/util/user_attr_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/util/zaml_spec.rb | 2 |
17 files changed, 17 insertions, 17 deletions
diff --git a/spec/unit/util/autoload_spec.rb b/spec/unit/util/autoload_spec.rb index eb0b705f4..808885dd7 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 98ddb92f6..a7d261dcf 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 2500403d0..da1b8b0bd 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 8cedade7d..365428752 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 8fafb1d52..e9dbe9d7b 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 68ef9d6eb..012631b91 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 edfa405a1..75afb57cb 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 29df0787a..3c8577493 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 411cd17a9..97ffc0b25 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 600b88f85..425812297 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 049ed1044..8bfcd900e 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 dbc90d9d0..6d7351220 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 474ddafa4..08758ee38 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 8545def54..ab54c8cd3 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 93c4f9bfa..3b5248528 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 61312ef19..5acdaee58 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 358c6aa11..804aa8e58 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' |
