summaryrefslogtreecommitdiff
path: root/spec/unit/provider
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider')
-rw-r--r--spec/unit/provider/dsc_resource_spec.rb2
-rw-r--r--spec/unit/provider/git_spec.rb76
-rw-r--r--spec/unit/provider/ohai_spec.rb2
-rw-r--r--spec/unit/provider/package/zypper_spec.rb8
-rw-r--r--spec/unit/provider/remote_directory_spec.rb12
-rw-r--r--spec/unit/provider/service/macosx_spec.rb2
-rw-r--r--spec/unit/provider/template/content_spec.rb56
7 files changed, 79 insertions, 79 deletions
diff --git a/spec/unit/provider/dsc_resource_spec.rb b/spec/unit/provider/dsc_resource_spec.rb
index 82ee5a40b3..6edf0963b8 100644
--- a/spec/unit/provider/dsc_resource_spec.rb
+++ b/spec/unit/provider/dsc_resource_spec.rb
@@ -36,7 +36,7 @@ describe Chef::Provider::DscResource do
it "raises a ProviderNotFound exception" do
expect(provider).not_to receive(:meta_configuration)
expect { provider.run_action(:run) }.to raise_error(
- Chef::Exceptions::ProviderNotFound, /5\.0\.10018\.0/)
+ Chef::Exceptions::ProviderNotFound, /5\.0\.10018\.0/)
end
end
diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb
index b1409ee1f4..9a6ae31397 100644
--- a/spec/unit/provider/git_spec.rb
+++ b/spec/unit/provider/git_spec.rb
@@ -377,7 +377,7 @@ describe Chef::Provider::Git do
version_response = double("shell_out")
allow(version_response).to receive(:stdout) { "git version 1.7.9" }
expect(@provider).to receive(:shell_out!).with("git --version",
- log_tag: "git[web2.0 app]").and_return(version_response)
+ log_tag: "git[web2.0 app]").and_return(version_response)
expect(@provider).to receive(:shell_out!).with(expected_cmd, log_tag: "git[web2.0 app]")
@provider.clone
end
@@ -388,7 +388,7 @@ describe Chef::Provider::Git do
version_response = double("shell_out")
allow(version_response).to receive(:stdout) { "git version 1.7.10" }
expect(@provider).to receive(:shell_out!).with("git --version",
- log_tag: "git[web2.0 app]").and_return(version_response)
+ log_tag: "git[web2.0 app]").and_return(version_response)
expect(@provider).to receive(:shell_out!).with(expected_cmd, log_tag: "git[web2.0 app]")
@provider.clone
end
@@ -489,13 +489,13 @@ describe Chef::Provider::Git do
allow(command_response).to receive(:exitstatus) { 1 }
expected_command = "git config --get remote.#{@resource.remote}.url"
expect(@provider).to receive(:shell_out!).with(expected_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]",
- returns: [0, 1, 2]).and_return(command_response)
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]",
+ returns: [0, 1, 2]).and_return(command_response)
add_remote_command = "git remote add #{@resource.remote} #{@resource.repository}"
expect(@provider).to receive(:shell_out!).with(add_remote_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]")
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
end
@@ -507,19 +507,19 @@ describe Chef::Provider::Git do
allow(command_response).to receive(:exitstatus) { 1 }
expected_command = "git config --get remote.#{@resource.remote}.url"
expect(@provider).to receive(:shell_out!).with(expected_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]",
- user: "whois",
- group: "thisis",
- environment: { "HOME" => "/home/whois" },
- returns: [0, 1, 2]).and_return(command_response)
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]",
+ user: "whois",
+ group: "thisis",
+ environment: { "HOME" => "/home/whois" },
+ returns: [0, 1, 2]).and_return(command_response)
add_remote_command = "git remote add #{@resource.remote} #{@resource.repository}"
expect(@provider).to receive(:shell_out!).with(add_remote_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]",
- user: "whois",
- group: "thisis",
- environment: { "HOME" => "/home/whois" })
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]",
+ user: "whois",
+ group: "thisis",
+ environment: { "HOME" => "/home/whois" })
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
end
@@ -529,13 +529,13 @@ describe Chef::Provider::Git do
allow(command_response).to receive(:exitstatus) { 1 }
check_remote_command = "git config --get remote.#{@resource.remote}.url"
expect(@provider).to receive(:shell_out!).with(check_remote_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]",
- returns: [0, 1, 2]).and_return(command_response)
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]",
+ returns: [0, 1, 2]).and_return(command_response)
expected_command = "git remote add #{@resource.remote} #{@resource.repository}"
expect(@provider).to receive(:shell_out!).with(expected_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]")
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
end
end
@@ -547,13 +547,13 @@ describe Chef::Provider::Git do
allow(command_response).to receive(:stdout) { "some_other_url" }
check_remote_command = "git config --get remote.#{@resource.remote}.url"
expect(@provider).to receive(:shell_out!).with(check_remote_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]",
- returns: [0, 1, 2]).and_return(command_response)
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]",
+ returns: [0, 1, 2]).and_return(command_response)
expected_command = "git config --replace-all remote.#{@resource.remote}.url \"#{@resource.repository}\""
expect(@provider).to receive(:shell_out!).with(expected_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]")
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
end
@@ -563,13 +563,13 @@ describe Chef::Provider::Git do
allow(command_response).to receive(:stdout) { @resource.repository }
check_remote_command = "git config --get remote.#{@resource.remote}.url"
expect(@provider).to receive(:shell_out!).with(check_remote_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]",
- returns: [0, 1, 2]).and_return(command_response)
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]",
+ returns: [0, 1, 2]).and_return(command_response)
unexpected_command = "git config --replace-all remote.#{@resource.remote}.url \"#{@resource.repository}\""
expect(@provider).not_to receive(:shell_out!).with(unexpected_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]")
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
end
@@ -578,13 +578,13 @@ describe Chef::Provider::Git do
allow(command_response).to receive(:exitstatus) { 2 }
check_remote_command = "git config --get remote.#{@resource.remote}.url"
expect(@provider).to receive(:shell_out!).with(check_remote_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]",
- returns: [0, 1, 2]).and_return(command_response)
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]",
+ returns: [0, 1, 2]).and_return(command_response)
expected_command = "git config --replace-all remote.#{@resource.remote}.url \"#{@resource.repository}\""
expect(@provider).to receive(:shell_out!).with(expected_command,
- cwd: "/my/deploy/dir",
- log_tag: "git[web2.0 app]")
+ cwd: "/my/deploy/dir",
+ log_tag: "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
end
end
diff --git a/spec/unit/provider/ohai_spec.rb b/spec/unit/provider/ohai_spec.rb
index 518523dca2..11f11e3373 100644
--- a/spec/unit/provider/ohai_spec.rb
+++ b/spec/unit/provider/ohai_spec.rb
@@ -43,7 +43,7 @@ describe Chef::Provider::Ohai do
}
allow(mock_ohai).to receive(:all_plugins).and_return(true)
allow(mock_ohai).to receive(:data).and_return(mock_ohai[:data],
- mock_ohai[:data2])
+ mock_ohai[:data2])
allow(Ohai::System).to receive(:new).and_return(mock_ohai)
allow(Chef::Platform).to receive(:find_platform_and_version).and_return({ "platform" => @platform,
"platform_version" => @platform_version })
diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb
index c17eeba1bb..a8ab2a0b37 100644
--- a/spec/unit/provider/package/zypper_spec.rb
+++ b/spec/unit/provider/package/zypper_spec.rb
@@ -223,7 +223,7 @@ describe Chef::Provider::Package::Zypper do
context "when package version is not explicitly specified" do
it "should run zypper remove with the package name" do
shell_out_expectation!(
- "zypper", "--non-interactive", "remove", "emacs"
+ "zypper", "--non-interactive", "remove", "emacs"
)
provider.remove_package(["emacs"], [nil])
end
@@ -239,14 +239,14 @@ describe Chef::Provider::Package::Zypper do
it "should run zypper remove without gpg checks" do
new_resource.gpg_check false
shell_out_expectation!(
- "zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0"
+ "zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0"
)
provider.remove_package(["emacs"], ["1.0"])
end
it "should run zypper remove without gpg checks when the config is false" do
Chef::Config[:zypper_check_gpg] = false
shell_out_expectation!(
- "zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0"
+ "zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0"
)
provider.remove_package(["emacs"], ["1.0"])
end
@@ -453,7 +453,7 @@ describe Chef::Provider::Package::Zypper do
describe "remove_package" do
it "should run zypper remove with the package name" do
shell_out_expectation!(
- "zypper", "remove", "-y", "emacs"
+ "zypper", "remove", "-y", "emacs"
)
provider.remove_package(["emacs"], ["1.0"])
end
diff --git a/spec/unit/provider/remote_directory_spec.rb b/spec/unit/provider/remote_directory_spec.rb
index d391da3010..f9559d8827 100644
--- a/spec/unit/provider/remote_directory_spec.rb
+++ b/spec/unit/provider/remote_directory_spec.rb
@@ -90,8 +90,8 @@ describe Chef::Provider::RemoteDirectory do
it "configures access control on files in the directory" do
@resource.cookbook "berlin_style_tasty_cupcakes"
cookbook_file = @provider.send(:cookbook_file_resource,
- "/target/destination/path.txt",
- "relative/source/path.txt")
+ "/target/destination/path.txt",
+ "relative/source/path.txt")
expect(cookbook_file.cookbook_name).to eq("berlin_style_tasty_cupcakes")
expect(cookbook_file.source).to eq("remotedir_root/relative/source/path.txt")
expect(cookbook_file.mode).to eq("0640")
@@ -104,14 +104,14 @@ describe Chef::Provider::RemoteDirectory do
@resource.cookbook "gondola_rides"
@resource.sensitive true
cookbook_file = @provider.send(:cookbook_file_resource,
- "/target/destination/path.txt",
- "relative/source/path.txt")
+ "/target/destination/path.txt",
+ "relative/source/path.txt")
expect(cookbook_file.sensitive).to eq(true)
@resource.sensitive false
cookbook_file = @provider.send(:cookbook_file_resource,
- "/target/destination/path.txt",
- "relative/source/path.txt")
+ "/target/destination/path.txt",
+ "relative/source/path.txt")
expect(cookbook_file.sensitive).to eq(false)
end
end
diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb
index e11cf6154e..420fd329f6 100644
--- a/spec/unit/provider/service/macosx_spec.rb
+++ b/spec/unit/provider/service/macosx_spec.rb
@@ -85,7 +85,7 @@ describe Chef::Provider::Service::Macosx do
allow(provider).to receive(:shell_out)
.with(/(#{su_cmd} '#{cmd}'|#{cmd})/, default_env: false)
.and_return(double("Status",
- stdout: launchctl_stdout, exitstatus: 0))
+ stdout: launchctl_stdout, exitstatus: 0))
allow(File).to receive(:exists?).and_return([true], [])
allow(provider).to receive(:shell_out!)
.with(/plutil -convert xml1 -o/, default_env: false)
diff --git a/spec/unit/provider/template/content_spec.rb b/spec/unit/provider/template/content_spec.rb
index 572cf23181..60ff18c123 100644
--- a/spec/unit/provider/template/content_spec.rb
+++ b/spec/unit/provider/template/content_spec.rb
@@ -30,20 +30,20 @@ describe Chef::Provider::Template::Content do
let(:new_resource) do
double("Chef::Resource::Template (new)",
- cookbook_name: "openldap",
- recipe_name: "default",
- source_line: "/Users/lamont/solo/cookbooks/openldap/recipes/default.rb:2:in `from_file'",
- source_line_file: "/Users/lamont/solo/cookbooks/openldap/recipes/default.rb",
- source_line_number: "2",
- source: "openldap_stuff.conf.erb",
- name: "openldap_stuff.conf",
- path: resource_path,
- local: false,
- cookbook: nil,
- variables: {},
- inline_helper_blocks: {},
- inline_helper_modules: [],
- helper_modules: [])
+ cookbook_name: "openldap",
+ recipe_name: "default",
+ source_line: "/Users/lamont/solo/cookbooks/openldap/recipes/default.rb:2:in `from_file'",
+ source_line_file: "/Users/lamont/solo/cookbooks/openldap/recipes/default.rb",
+ source_line_number: "2",
+ source: "openldap_stuff.conf.erb",
+ name: "openldap_stuff.conf",
+ path: resource_path,
+ local: false,
+ cookbook: nil,
+ variables: {},
+ inline_helper_blocks: {},
+ inline_helper_modules: [],
+ helper_modules: [])
end
let(:rendered_file_locations) do
@@ -130,20 +130,20 @@ describe Chef::Provider::Template::Content do
describe "when using location helpers" do
let(:new_resource) do
double("Chef::Resource::Template (new)",
- cookbook_name: "openldap",
- recipe_name: "default",
- source_line: CHEF_SPEC_DATA + "/cookbooks/openldap/recipes/default.rb:2:in `from_file'",
- source_line_file: CHEF_SPEC_DATA + "/cookbooks/openldap/recipes/default.rb",
- source_line_number: "2",
- source: "helpers.erb",
- name: "helpers.erb",
- path: CHEF_SPEC_DATA + "/cookbooks/openldap/templates/default/helpers.erb",
- local: false,
- cookbook: nil,
- variables: {},
- inline_helper_blocks: {},
- inline_helper_modules: [],
- helper_modules: [])
+ cookbook_name: "openldap",
+ recipe_name: "default",
+ source_line: CHEF_SPEC_DATA + "/cookbooks/openldap/recipes/default.rb:2:in `from_file'",
+ source_line_file: CHEF_SPEC_DATA + "/cookbooks/openldap/recipes/default.rb",
+ source_line_number: "2",
+ source: "helpers.erb",
+ name: "helpers.erb",
+ path: CHEF_SPEC_DATA + "/cookbooks/openldap/templates/default/helpers.erb",
+ local: false,
+ cookbook: nil,
+ variables: {},
+ inline_helper_blocks: {},
+ inline_helper_modules: [],
+ helper_modules: [])
end
it "creates the template with the rendered content" do