summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-06-25 22:23:27 -0700
committerdanielsdeleo <dan@opscode.com>2013-06-26 10:47:47 -0700
commit02cce01e2d351a5974fc10ee755ddf9c9fd36a5d (patch)
treedd54e26f75935a59d9a7b2b8121383a3f929a3c5 /spec/spec_helper.rb
parent7b4a67335fa6145d7d4675e1a17549ef7c1ce4d7 (diff)
downloadchef-02cce01e2d351a5974fc10ee755ddf9c9fd36a5d.tar.gz
Fix spec file loading annoyances
- Don't load all knife subcommands. Fixes error running tests on 1.8 when you have 1.9-only plugins installed. - Adjust spec file loading to use paths relative to spec/
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index c3619dd773..0cdbfe97e4 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -53,7 +53,12 @@ end
require 'chef'
require 'chef/knife'
-Chef::Knife.load_commands
+
+Dir['lib/chef/knife/**/*.rb'].
+ map {|f| f.gsub('lib/', '') }.
+ map {|f| f.gsub(%r[\.rb$], '') }.
+ each {|f| require f }
+
require 'chef/mixins'
require 'chef/dsl'
require 'chef/application'
@@ -75,6 +80,7 @@ require 'spec/support/platform_helpers'
Dir["spec/support/**/*.rb"].
reject { |f| f =~ %r{^spec/support/platforms} }.
map { |f| f.gsub(%r{.rb$}, '') }.
+ map { |f| f.gsub(%r[spec/], '')}.
each { |f| require f }
RSpec.configure do |config|