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/indirector | |
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/indirector')
-rwxr-xr-x | spec/unit/indirector/file_bucket_file/rest_spec.rb | 2 | ||||
-rwxr-xr-x | spec/unit/indirector/resource/rest_spec.rb | 2 | ||||
-rwxr-xr-x | spec/unit/indirector/status/rest_spec.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/spec/unit/indirector/file_bucket_file/rest_spec.rb b/spec/unit/indirector/file_bucket_file/rest_spec.rb index 960f60ae7..d0f714751 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 351aee33b..1285d338a 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 5eed5fc93..436c86881 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' |