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/integration/provider | |
| 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/integration/provider')
| -rwxr-xr-x | spec/integration/provider/package_spec.rb | 2 | ||||
| -rwxr-xr-x | spec/integration/provider/service/init_spec.rb | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/spec/integration/provider/package_spec.rb b/spec/integration/provider/package_spec.rb index 472662d6b..cc03c57a7 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 2e2505bd4..c74ce29fe 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) |
