summaryrefslogtreecommitdiff
path: root/spec/unit/knife_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/knife_spec.rb')
-rw-r--r--spec/unit/knife_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb
index 698ae205f1..ec1e59d863 100644
--- a/spec/unit/knife_spec.rb
+++ b/spec/unit/knife_spec.rb
@@ -23,6 +23,7 @@ end
require "spec_helper"
require "uri"
+require "chef/knife/core/gem_glob_loader"
describe Chef::Knife do
@@ -148,6 +149,12 @@ describe Chef::Knife do
expect(Chef::Knife.subcommand_class_from(%w{cookbook site vendor --help foo bar baz})).to eq(:CookbookSiteVendor)
end
+ it "special case sets the subcommand_loader to GemGlobLoader when running rehash" do
+ Chef::Knife.subcommands["rehash"] = :Rehash
+ expect(Chef::Knife.subcommand_class_from(%w{rehash })).to eq(:Rehash)
+ expect(Chef::Knife.subcommand_loader).to be_a(Chef::Knife::SubcommandLoader::GemGlobLoader)
+ end
+
end
describe "the headers include X-Remote-Request-Id" do