2014-10-31 20:06:05 +00:00
|
|
|
require_relative "../../../base"
|
|
|
|
|
|
|
|
require Vagrant.source_root.join("plugins/provisioners/chef/omnibus")
|
|
|
|
|
2015-01-07 20:51:55 +00:00
|
|
|
describe VagrantPlugins::Chef::Omnibus do
|
2015-11-19 23:01:09 +00:00
|
|
|
describe "#sh_command" do
|
|
|
|
it "includes the project name" do
|
2017-06-14 10:34:52 +00:00
|
|
|
command = described_class.sh_command("chef", nil, "stable", "https://omnitruck.chef.io")
|
2015-11-19 23:01:09 +00:00
|
|
|
expect(command).to include %|-P "chef"|
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
2014-12-16 22:29:47 +00:00
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
it "includes the channel" do
|
2017-06-14 10:34:52 +00:00
|
|
|
command = described_class.sh_command("chef", nil, "stable", "https://omnitruck.chef.io")
|
2015-11-19 23:01:09 +00:00
|
|
|
expect(command).to include %|-c "stable"|
|
2014-12-16 22:29:47 +00:00
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
it "includes the version" do
|
2017-06-14 10:34:52 +00:00
|
|
|
command = described_class.sh_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io")
|
2015-11-19 23:01:09 +00:00
|
|
|
expect(command).to include %|-v "1.2.3"|
|
|
|
|
end
|
2014-10-31 20:06:05 +00:00
|
|
|
|
2017-06-14 10:34:52 +00:00
|
|
|
it "includes the Omnibus installation URL" do
|
|
|
|
command = described_class.sh_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io")
|
|
|
|
expect(command).to include %|https://omnitruck.chef.io/install.sh|
|
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
it "includes the download path" do
|
2017-06-14 10:34:52 +00:00
|
|
|
command = described_class.sh_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io",
|
2015-11-19 23:01:09 +00:00
|
|
|
download_path: "/some/path",
|
|
|
|
)
|
|
|
|
expect(command).to include %|-d "/some/path"|
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
describe "#ps_command" do
|
|
|
|
it "includes the project name" do
|
2017-06-14 10:34:52 +00:00
|
|
|
command = described_class.ps_command("chef", nil, "stable", "https://omnitruck.chef.io")
|
2015-11-19 23:01:09 +00:00
|
|
|
expect(command).to include %|-project 'chef'|
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
it "includes the channel" do
|
2017-06-14 10:34:52 +00:00
|
|
|
command = described_class.ps_command("chef", nil, "stable", "https://omnitruck.chef.io")
|
2015-11-19 23:01:09 +00:00
|
|
|
expect(command).to include %|-channel 'stable'|
|
|
|
|
end
|
2014-10-31 20:06:05 +00:00
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
it "includes the version" do
|
2017-06-14 10:34:52 +00:00
|
|
|
command = described_class.ps_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io")
|
2015-11-19 23:01:09 +00:00
|
|
|
expect(command).to include %|-version '1.2.3'|
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
2017-06-14 10:34:52 +00:00
|
|
|
|
|
|
|
it "includes the Omnibus installation URL" do
|
|
|
|
command = described_class.ps_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io")
|
|
|
|
expect(command).to include %|https://omnitruck.chef.io/install.ps1|
|
|
|
|
end
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
|
|
|
end
|