summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-06-26 10:47:38 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-06-26 10:47:38 -0700
commit8dffd98327782cec61f5e3765789a84c563d85d2 (patch)
treed3871ab340c4d8761d4d9e1c6f50a7367ffbbbb1
parent9d75e3b7cc2e87eb3c7950561a2c064feeb243f1 (diff)
downloadchef-8dffd98327782cec61f5e3765789a84c563d85d2.tar.gz
revert these changes as they break everything else other than windows
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/knife/cookbook_upload_spec.rb11
-rw-r--r--spec/unit/knife/core/windows_bootstrap_context_spec.rb18
2 files changed, 13 insertions, 16 deletions
diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb
index a81fddeb1d..661eb779ea 100644
--- a/spec/unit/knife/cookbook_upload_spec.rb
+++ b/spec/unit/knife/cookbook_upload_spec.rb
@@ -323,18 +323,19 @@ describe Chef::Knife::CookbookUpload do
context "when cookbook path is an array" do
it "should warn users that no cookbooks exist" do
- coockbook_path = windows? ? "C:/chef-repo/cookbooks" : "C:/chef-repo/cookbooks"
- knife.config[:cookbook_path] = [coockbook_path, "/home/user/cookbooks"]
- expect(knife.ui).to receive(:warn).with("Could not find any cookbooks in your cookbook path: '#{knife.config[:cookbook_path].join(", ")}'. Use --cookbook-path to specify the desired path.")
+ knife.config[:cookbook_path] = ["/chef-repo/cookbooks", "/home/user/cookbooks"]
+ expect(knife.ui).to receive(:warn).with(
+ /Could not find any cookbooks in your cookbook path: '#{knife.config[:cookbook_path].join(', ')}'\. Use --cookbook-path to specify the desired path\./
+ )
knife.run
end
end
context "when cookbook path is a string" do
it "should warn users that no cookbooks exist" do
- knife.config[:cookbook_path] = windows? ? "C:/chef-repo/cookbooks" : "C:/chef-repo/cookbooks"
+ knife.config[:cookbook_path] = "/chef-repo/cookbooks"
expect(knife.ui).to receive(:warn).with(
- "Could not find any cookbooks in your cookbook path: '#{knife.config[:cookbook_path]}'. Use --cookbook-path to specify the desired path."
+ /Could not find any cookbooks in your cookbook path: '#{knife.config[:cookbook_path]}'\. Use --cookbook-path to specify the desired path\./
)
knife.run
end
diff --git a/spec/unit/knife/core/windows_bootstrap_context_spec.rb b/spec/unit/knife/core/windows_bootstrap_context_spec.rb
index 56467d12ab..6b041c5311 100644
--- a/spec/unit/knife/core/windows_bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/windows_bootstrap_context_spec.rb
@@ -148,26 +148,22 @@ describe Chef::Knife::Core::WindowsBootstrapContext do
describe "#config_content" do
before do
- root_path = windows? ? "c:/chef" : "/chef"
-
bootstrap_context.instance_variable_set(:@chef_config, Mash.new(config_log_level: :info,
config_log_location: STDOUT,
chef_server_url: "http://chef.example.com:4444",
validation_client_name: "chef-validator-testing",
- file_cache_path: windows? ? "#{root_path}/cache" : "#{root_path}/cache",
- file_backup_path: windows? ? "#{root_path}/backup" : "#{root_path}/backup",
- cache_options: ({ path: "#{root_path}/cache/checksums", skip_expires: true })))
+ file_cache_path: "c:/chef/cache",
+ file_backup_path: "c:/chef/backup",
+ cache_options: ({ path: "c:/chef/cache/checksums", skip_expires: true })))
end
it "generates the config file data" do
- root_path = windows? ? "C:\\chef" : "\\chef"
-
expected = <<~EXPECTED
echo.chef_server_url "http://chef.example.com:4444"
echo.validation_client_name "chef-validator-testing"
- echo.file_cache_path "#{root_path}/cache"
- echo.file_backup_path "#{root_path}/backup"
- echo.cache_options ^({:path =^> "#{root_path}/cache/checksums", :skip_expires =^> true}^)
+ echo.file_cache_path "C:/chef/cache"
+ echo.file_backup_path "C:/chef/backup"
+ echo.cache_options ^({:path =^> "C:/chef/cache/checksums", :skip_expires =^> true}^)
echo.# Using default node name ^(fqdn^)
echo.log_level :info
echo.log_location STDOUT
@@ -187,7 +183,7 @@ describe Chef::Knife::Core::WindowsBootstrapContext do
describe "#start_chef" do
it "returns the expected string" do
- expect(bootstrap_context.start_chef).to match(/SET \"PATH=%SystemRoot%\\system32;%SystemRoot%;%SystemRoot%\\System32\\Wbem;%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\;C:\\ruby\\bin;C:\\opscode\\chef\\bin;C:\\opscode\\chef\\embedded\\bin\;%PATH%\"\n/)
+ expect(bootstrap_context.start_chef).to match(%r{SET \"PATH=%SystemRoot%\\system32;%SystemRoot%;%SystemRoot%\\System32\\Wbem;%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\;C:\\ruby\\bin;C:\/opscode\/chef\\bin;C:\/opscode\/chef\\embedded\\bin\;%PATH%\"\n})
end
end