diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-04-24 13:12:45 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-05-01 10:50:31 -0700 |
commit | 55f3a1be1e8ef45beb1d24f25882d5fefb854a63 (patch) | |
tree | 5e3f8333f4292acd6119dc598d75d3db7ecf948b /chef/spec/spec_helper.rb | |
parent | 85f85894b525d833b533882b9411e1b4d72345af (diff) | |
download | chef-55f3a1be1e8ef45beb1d24f25882d5fefb854a63.tar.gz |
[CHEF-489] refactor require()s so files don't double load
* For now, had to disable some explicit requirements. These are marked
with CHEF489TODO
* rejiggered Chef::Platform so it hides all of the constants for
providers in a method call. This is only sustainable if we give up on
explicit requirements for Chef::Platform or place restrictions on
where it can be required from.
* created providers.rb resources.rb and mixins.rb which are just a bunch
of requires for the various types of files
* All tests pass on Ruby 1.8
* 110 test failures on Ruby 1.9.2 HEAD, mostly around String#each not
existing any more, and implicit type conversions that no longer occur.
Diffstat (limited to 'chef/spec/spec_helper.rb')
-rw-r--r-- | chef/spec/spec_helper.rb | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/chef/spec/spec_helper.rb b/chef/spec/spec_helper.rb index 7ed764a34a..9a62ae7a70 100644 --- a/chef/spec/spec_helper.rb +++ b/chef/spec/spec_helper.rb @@ -23,24 +23,29 @@ module Shef end $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) -$:.unshift(File.join(File.dirname(__FILE__), "..", "..", "chef-server", "lib")) +#$:.unshift(File.join(File.dirname(__FILE__), "..", "..", "chef-server", "lib")) require 'chef' -require File.join(File.dirname(__FILE__), "/../lib/chef/util/file_edit") +require 'chef/knife' +Chef::Knife.load_commands +require 'chef/mixins' +require 'chef/shef' +require 'chef/util/file_edit' -chef_lib_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) -Dir[ - File.expand_path( - File.join( - chef_lib_path, 'chef', '**', '*.rb' - ) - ) -].sort.each do |lib| - lib_short_path = lib.match("^#{chef_lib_path}#{File::SEPARATOR}(.+)$")[1] - require lib_short_path -end -Dir[File.join(File.dirname(__FILE__), 'lib', '**', '*.rb')].sort.each { |lib| require lib } +# chef_lib_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) +# Dir[ +# File.expand_path( +# File.join( +# chef_lib_path, 'chef', '**', '*.rb' +# ) +# ) +# ].sort.each do |lib| +# lib_short_path = lib.match("^#{chef_lib_path}#{File::SEPARATOR}(.+)$")[1] +# require lib_short_path +# end +Dir[File.join(File.dirname(__FILE__), 'lib', '**', '*.rb')].sort.each { |lib| require lib } +# Chef::Config[:log_level] = :fatal Chef::Config[:cache_type] = "Memory" Chef::Config[:cache_options] = { } |