summaryrefslogtreecommitdiffstats
path: root/spec/unit/indirector
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-03-22 11:31:14 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-03-22 11:39:24 -0700
commitf6da3339f59bbd9243a03dc1e417b1fed7955c7e (patch)
treecc264fef5811c7d5e8000bc4048bab86b87064a0 /spec/unit/indirector
parent307df20d7dfd4f5a2a3b67fc2587491560ee951c (diff)
downloadpuppet-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-xspec/unit/indirector/file_bucket_file/rest_spec.rb2
-rwxr-xr-xspec/unit/indirector/resource/rest_spec.rb2
-rwxr-xr-xspec/unit/indirector/status/rest_spec.rb2
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'