summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/application/client_spec.rb16
-rw-r--r--spec/unit/cookbook/synchronizer_spec.rb8
-rw-r--r--spec/unit/environment_spec.rb2
-rw-r--r--spec/unit/file_content_management/deploy/mv_unix_spec.rb6
-rw-r--r--spec/unit/file_content_management/deploy/mv_windows_spec.rb4
-rw-r--r--spec/unit/key_spec.rb12
-rw-r--r--spec/unit/knife/bootstrap_spec.rb6
-rw-r--r--spec/unit/knife/cookbook_delete_spec.rb4
-rw-r--r--spec/unit/knife/core/hashed_command_loader_spec.rb4
-rw-r--r--spec/unit/knife/raw_spec.rb4
-rw-r--r--spec/unit/knife_spec.rb14
-rw-r--r--spec/unit/mixin/params_validate_spec.rb8
-rw-r--r--spec/unit/node/vivid_mash_spec.rb8
-rw-r--r--spec/unit/property/state_spec.rb4
-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
-rw-r--r--spec/unit/resource_collection/resource_set_spec.rb12
-rw-r--r--spec/unit/resource_reporter_spec.rb8
-rw-r--r--spec/unit/shell/shell_session_spec.rb10
-rw-r--r--spec/unit/version_class_spec.rb2
25 files changed, 145 insertions, 145 deletions
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb
index df1b6c99e2..0773fc70fd 100644
--- a/spec/unit/application/client_spec.rb
+++ b/spec/unit/application/client_spec.rb
@@ -120,8 +120,8 @@ describe Chef::Application::Client, "reconfigure" do
describe "--named-run-list" do
it_behaves_like "sets the configuration",
- "--named-run-list arglebargle-example",
- named_run_list: "arglebargle-example"
+ "--named-run-list arglebargle-example",
+ named_run_list: "arglebargle-example"
end
describe "--no-listen" do
@@ -131,17 +131,17 @@ describe Chef::Application::Client, "reconfigure" do
describe "--daemonize", :unix_only do
context "with no value" do
it_behaves_like "sets the configuration", "--daemonize",
- daemonize: true
+ daemonize: true
end
context "with an integer value" do
it_behaves_like "sets the configuration", "--daemonize 5",
- daemonize: 5
+ daemonize: 5
end
context "with a non-integer value" do
it_behaves_like "sets the configuration", "--daemonize foo",
- daemonize: true
+ daemonize: true
end
end
@@ -178,17 +178,17 @@ describe Chef::Application::Client, "reconfigure" do
describe "--config-option" do
context "with a single value" do
it_behaves_like "sets the configuration", "--config-option chef_server_url=http://example",
- chef_server_url: "http://example"
+ chef_server_url: "http://example"
end
context "with two values" do
it_behaves_like "sets the configuration", "--config-option chef_server_url=http://example --config-option policy_name=web",
- chef_server_url: "http://example", policy_name: "web"
+ chef_server_url: "http://example", policy_name: "web"
end
context "with a boolean value" do
it_behaves_like "sets the configuration", "--config-option minimal_ohai=true",
- minimal_ohai: true
+ minimal_ohai: true
end
context "with an empty value" do
diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb
index dc68bf1824..0762a11771 100644
--- a/spec/unit/cookbook/synchronizer_spec.rb
+++ b/spec/unit/cookbook/synchronizer_spec.rb
@@ -199,22 +199,22 @@ describe Chef::CookbookSynchronizer do
let(:cookbook_a_default_recipe_tempfile) do
double("Tempfile for cookbook_a default.rb recipe",
- path: "/tmp/cookbook_a_recipes_default_rb")
+ path: "/tmp/cookbook_a_recipes_default_rb")
end
let(:cookbook_a_default_attribute_tempfile) do
double("Tempfile for cookbook_a default.rb attr file",
- path: "/tmp/cookbook_a_attributes_default_rb")
+ path: "/tmp/cookbook_a_attributes_default_rb")
end
let(:cookbook_a_file_default_tempfile) do
double("Tempfile for cookbook_a megaman.conf file",
- path: "/tmp/cookbook_a_file_default_tempfile")
+ path: "/tmp/cookbook_a_file_default_tempfile")
end
let(:cookbook_a_template_default_tempfile) do
double("Tempfile for cookbook_a apache.conf.erb template",
- path: "/tmp/cookbook_a_template_default_tempfile")
+ path: "/tmp/cookbook_a_template_default_tempfile")
end
def setup_common_files_missing_expectations
diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb
index aa4c105c3a..4da3a9fa0e 100644
--- a/spec/unit/environment_spec.rb
+++ b/spec/unit/environment_spec.rb
@@ -299,7 +299,7 @@ describe Chef::Environment do
expect do
Chef::Environment.validate_cookbook_version("= 1.2.3.4")
end.to raise_error Chef::Exceptions::IllegalVersionConstraint,
- /Environment cookbook version constraints not allowed in .*/
+ /Environment cookbook version constraints not allowed in .*/
end
end
diff --git a/spec/unit/file_content_management/deploy/mv_unix_spec.rb b/spec/unit/file_content_management/deploy/mv_unix_spec.rb
index a31074e4bd..491457e8c6 100644
--- a/spec/unit/file_content_management/deploy/mv_unix_spec.rb
+++ b/spec/unit/file_content_management/deploy/mv_unix_spec.rb
@@ -38,9 +38,9 @@ describe Chef::FileContentManagement::Deploy::MvUnix do
let(:target_file_mode) { 0644 }
let(:target_file_stat) do
double "File::Stat struct for target file",
- mode: target_file_mode,
- uid: target_file_uid,
- gid: target_file_gid
+ mode: target_file_mode,
+ uid: target_file_uid,
+ gid: target_file_gid
end
before do
diff --git a/spec/unit/file_content_management/deploy/mv_windows_spec.rb b/spec/unit/file_content_management/deploy/mv_windows_spec.rb
index 80155f131c..1aadf89d2d 100644
--- a/spec/unit/file_content_management/deploy/mv_windows_spec.rb
+++ b/spec/unit/file_content_management/deploy/mv_windows_spec.rb
@@ -84,8 +84,8 @@ describe Chef::FileContentManagement::Deploy::MvWindows do
let(:target_file_security_descriptor) do
double "security descriptor for target file",
- group: original_target_file_group,
- owner: original_target_file_owner
+ group: original_target_file_group,
+ owner: original_target_file_owner
end
let(:updated_target_security_descriptor) do
diff --git a/spec/unit/key_spec.rb b/spec/unit/key_spec.rb
index 63c5982137..e3d9f8e7ad 100644
--- a/spec/unit/key_spec.rb
+++ b/spec/unit/key_spec.rb
@@ -406,9 +406,9 @@ describe Chef::Key do
it "creates a new key via the API with the fingerprint as the name" do
expect(rest).to receive(:post).with(url,
- { "name" => "12:3e:33:73:0b:f4:ec:72:dc:f0:4c:51:62:27:08:76:96:24:f4:4a",
- "public_key" => key.public_key,
- "expiration_date" => key.expiration_date }).and_return({})
+ { "name" => "12:3e:33:73:0b:f4:ec:72:dc:f0:4c:51:62:27:08:76:96:24:f4:4a",
+ "public_key" => key.public_key,
+ "expiration_date" => key.expiration_date }).and_return({})
key.create
end
end
@@ -424,9 +424,9 @@ describe Chef::Key do
context "when create_key is false" do
it "creates a new key via the API" do
expect(rest).to receive(:post).with(url,
- { "name" => key.name,
- "public_key" => key.public_key,
- "expiration_date" => key.expiration_date }).and_return({})
+ { "name" => key.name,
+ "public_key" => key.public_key,
+ "expiration_date" => key.expiration_date }).and_return({})
key.create
end
end
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index bf2c7c4902..ee376e2bb4 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -33,9 +33,9 @@ describe Chef::Knife::Bootstrap do
let(:connection) do
double("TrainConnector",
- windows?: windows_test,
- linux?: linux_test,
- unix?: unix_test) end
+ windows?: windows_test,
+ linux?: linux_test,
+ unix?: unix_test) end
let(:knife) do
Chef::Log.logger = Logger.new(StringIO.new)
diff --git a/spec/unit/knife/cookbook_delete_spec.rb b/spec/unit/knife/cookbook_delete_spec.rb
index f65a26c455..b2f17778cd 100644
--- a/spec/unit/knife/cookbook_delete_spec.rb
+++ b/spec/unit/knife/cookbook_delete_spec.rb
@@ -76,8 +76,8 @@ describe Chef::Knife::CookbookDelete do
@knife.cookbook_name = "foobar"
@knife.version = "1.0.0"
expect(@knife).to receive(:delete_object).with(Chef::CookbookVersion,
- "foobar version 1.0.0",
- "cookbook").and_yield()
+ "foobar version 1.0.0",
+ "cookbook").and_yield()
expect(@knife).to receive(:delete_request).with("cookbooks/foobar/1.0.0")
@knife.delete_explicit_version
end
diff --git a/spec/unit/knife/core/hashed_command_loader_spec.rb b/spec/unit/knife/core/hashed_command_loader_spec.rb
index e866f13a9c..c59838478e 100644
--- a/spec/unit/knife/core/hashed_command_loader_spec.rb
+++ b/spec/unit/knife/core/hashed_command_loader_spec.rb
@@ -43,8 +43,8 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do
let(:loader) do
Chef::Knife::SubcommandLoader::HashedCommandLoader.new(
- File.join(CHEF_SPEC_DATA, "knife-site-subcommands"),
- plugin_manifest) end
+ File.join(CHEF_SPEC_DATA, "knife-site-subcommands"),
+ plugin_manifest) end
describe "#list_commands" do
before do
diff --git a/spec/unit/knife/raw_spec.rb b/spec/unit/knife/raw_spec.rb
index 9202998fb9..d1300e9437 100644
--- a/spec/unit/knife/raw_spec.rb
+++ b/spec/unit/knife/raw_spec.rb
@@ -35,8 +35,8 @@ describe Chef::Knife::Raw do
it "should set the x-ops-request-source header when --proxy-auth is set" do
knife.config[:proxy_auth] = true
expect(rest).to receive(:request).with(:GET, "/nodes",
- { "Content-Type" => "application/json",
- "x-ops-request-source" => "web" }, false)
+ { "Content-Type" => "application/json",
+ "x-ops-request-source" => "web" }, false)
knife.run
end
end
diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb
index 169265c52d..2c14e417b4 100644
--- a/spec/unit/knife_spec.rb
+++ b/spec/unit/knife_spec.rb
@@ -35,9 +35,9 @@ describe Chef::Knife do
let(:config_loader) do
instance_double("WorkstationConfigLoader",
- load: nil, no_config_found?: false,
- config_location: config_location,
- chef_config_dir: "/etc/chef")
+ load: nil, no_config_found?: false,
+ config_location: config_location,
+ chef_config_dir: "/etc/chef")
end
before(:each) do
@@ -285,8 +285,8 @@ describe Chef::Knife do
before do
KnifeSpecs::TestYourself.option(:opt_with_default,
- short: "-D VALUE",
- default: "default-value")
+ short: "-D VALUE",
+ default: "default-value")
end
# This supports a use case used by plugins, where the pattern
# seems to follow:
@@ -308,8 +308,8 @@ describe Chef::Knife do
describe "merging configuration options" do
before do
KnifeSpecs::TestYourself.option(:opt_with_default,
- short: "-D VALUE",
- default: "default-value")
+ short: "-D VALUE",
+ default: "default-value")
end
it "sets the default log_location to STDERR for Chef::Log warnings" do
diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb
index 62d6b3e117..1cc7fef58e 100644
--- a/spec/unit/mixin/params_validate_spec.rb
+++ b/spec/unit/mixin/params_validate_spec.rb
@@ -334,22 +334,22 @@ describe Chef::Mixin::ParamsValidate do
it "asserts that a value returns false from a predicate method" do
expect do
@vo.validate({ not_blank: "should pass" },
- { not_blank: { cannot_be: [ :nil, :empty ] } })
+ { not_blank: { cannot_be: [ :nil, :empty ] } })
end.not_to raise_error
expect do
@vo.validate({ not_blank: "" },
- { not_blank: { cannot_be: [ :nil, :empty ] } })
+ { not_blank: { cannot_be: [ :nil, :empty ] } })
end.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "allows a custom validation message" do
expect do
@vo.validate({ not_blank: "should pass" },
- { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } })
+ { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } })
end.not_to raise_error
expect do
@vo.validate({ not_blank: "" },
- { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } })
+ { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } })
end.to raise_error(Chef::Exceptions::ValidationFailed, "my validation message")
end
diff --git a/spec/unit/node/vivid_mash_spec.rb b/spec/unit/node/vivid_mash_spec.rb
index cfdc813b50..575d8c3321 100644
--- a/spec/unit/node/vivid_mash_spec.rb
+++ b/spec/unit/node/vivid_mash_spec.rb
@@ -421,8 +421,8 @@ describe Chef::Node::AttrArray do
context "#compact!" do
it "VividMashes remain VividMashes" do
array = Chef::Node::AttrArray.new(
- [ nil, { "one" => "two" }, nil ],
- root
+ [ nil, { "one" => "two" }, nil ],
+ root
)
expect(array[1].class).to eql(Chef::Node::VividMash)
array.compact!
@@ -440,8 +440,8 @@ describe Chef::Node::AttrArray do
context "#flatten!" do
it "flattens sub-arrays maintaining VividMashes in them" do
array = Chef::Node::AttrArray.new(
- [ [ { "one" => "two" } ], [ { "one" => "two" } ] ],
- root
+ [ [ { "one" => "two" } ], [ { "one" => "two" } ] ],
+ root
)
expect(array[0][0].class).to eql(Chef::Node::VividMash)
array.flatten!
diff --git a/spec/unit/property/state_spec.rb b/spec/unit/property/state_spec.rb
index be19dd7ec2..5c54ec71b2 100644
--- a/spec/unit/property/state_spec.rb
+++ b/spec/unit/property/state_spec.rb
@@ -254,8 +254,8 @@ describe "Chef::Resource#identity and #state" do
end
with_property ":x, identity: true, default: 'xxx'",
- ":y, identity: true, default: 'yyy'",
- ":z, identity: true, default: 'zzz'" do
+ ":y, identity: true, default: 'yyy'",
+ ":z, identity: true, default: 'zzz'" do
it "identity_property raises an error if multiple identity values are defined" do
expect { resource_class.identity_property }.to raise_error Chef::Exceptions::MultipleIdentityError
end
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
diff --git a/spec/unit/resource_collection/resource_set_spec.rb b/spec/unit/resource_collection/resource_set_spec.rb
index 403be4c566..60053d2b71 100644
--- a/spec/unit/resource_collection/resource_set_spec.rb
+++ b/spec/unit/resource_collection/resource_set_spec.rb
@@ -92,7 +92,7 @@ describe Chef::ResourceCollection::ResourceSet do
collection.insert_as(zen_master)
collection.insert_as(zen_follower)
check_by_names(collection.find(zen_master: [zen_master_name], zen_follower: [zen_follower_name]),
- zen_master_name, zen_follower_name)
+ zen_master_name, zen_follower_name)
end
it "should find resources of multiple kinds (:zen_master => a, :zen_follower => b with custom names)" do
@@ -100,7 +100,7 @@ describe Chef::ResourceCollection::ResourceSet do
collection.insert_as(zen_master2, :zzz, "name2")
collection.insert_as(zen_follower, :yyy, "name3")
check_by_names(collection.find(zzz: %w{name1 name2}, yyy: ["name3"]),
- zen_master_name, zen_follower_name, zen_master2_name)
+ zen_master_name, zen_follower_name, zen_master2_name)
end
it "should find a resource by string zen_master[a]" do
@@ -118,7 +118,7 @@ describe Chef::ResourceCollection::ResourceSet do
collection.insert_as(zen_master)
collection.insert_as(zen_master2)
check_by_names(collection.find("zen_master[#{zen_master_name},#{zen_master2_name}]"),
- zen_master_name, zen_master2_name)
+ zen_master_name, zen_master2_name)
end
it "should find array names" do
@@ -138,14 +138,14 @@ describe Chef::ResourceCollection::ResourceSet do
collection.insert_as(zen_master, :zzz, "name1")
collection.insert_as(zen_master2, :zzz, "name2")
check_by_names(collection.find("zzz[name1,name2]"),
- zen_master_name, zen_master2_name)
+ zen_master_name, zen_master2_name)
end
it "should find resources of multiple types by strings of zen_master[a]" do
collection.insert_as(zen_master)
collection.insert_as(zen_follower)
check_by_names(collection.find("zen_master[#{zen_master_name}]", "zen_follower[#{zen_follower_name}]"),
- zen_master_name, zen_follower_name)
+ zen_master_name, zen_follower_name)
end
it "should find resources of multiple types by strings of zen_master[a] with custom names" do
@@ -154,7 +154,7 @@ describe Chef::ResourceCollection::ResourceSet do
collection.insert_as(zen_master2, :zzz, "name2")
collection.insert_as(zen_follower, :yyy, "name3")
check_by_names(collection.find("zzz[name1,name2]", "yyy[name3]"),
- zen_master_name, zen_follower_name, zen_master2_name)
+ zen_master_name, zen_follower_name, zen_master2_name)
end
it "should only keep the last copy when multiple instances of a Resource are inserted" do
diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb
index 2272c83967..a2ae786bb4 100644
--- a/spec/unit/resource_reporter_spec.rb
+++ b/spec/unit/resource_reporter_spec.rb
@@ -645,7 +645,7 @@ describe Chef::ResourceReporter do
expect(rest_client).to receive(:post)
.with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id,
start_time: start_time.to_s },
- { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION })
+ { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION })
.and_raise(@error)
end
@@ -674,7 +674,7 @@ describe Chef::ResourceReporter do
@error = Net::HTTPClientException.new("500 message", @response)
expect(rest_client).to receive(:post)
.with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: start_time.to_s },
- { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION })
+ { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION })
.and_raise(@error)
end
@@ -704,7 +704,7 @@ describe Chef::ResourceReporter do
@error = Net::HTTPClientException.new("500 message", @response)
expect(rest_client).to receive(:post)
.with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: start_time.to_s },
- { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION })
+ { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION })
.and_raise(@error)
end
@@ -725,7 +725,7 @@ describe Chef::ResourceReporter do
response = { "uri" => "https://example.com/reports/nodes/spitfire/runs/@run_id" }
expect(rest_client).to receive(:post)
.with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: start_time.to_s },
- { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION })
+ { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION })
.and_return(response)
resource_reporter.run_started(run_status)
end
diff --git a/spec/unit/shell/shell_session_spec.rb b/spec/unit/shell/shell_session_spec.rb
index 2e32e6547d..6644ff6e0c 100644
--- a/spec/unit/shell/shell_session_spec.rb
+++ b/spec/unit/shell/shell_session_spec.rb
@@ -238,11 +238,11 @@ describe Shell::SoloLegacySession do
it "passes the shell CLI args to the client" do
@client = double("Chef::Client.new",
- run_ohai: true,
- load_node: true,
- build_node: true,
- register: true,
- sync_cookbooks: {})
+ run_ohai: true,
+ load_node: true,
+ build_node: true,
+ register: true,
+ sync_cookbooks: {})
expect(Chef::Client).to receive(:new).with(json_attribs, Chef::Config[:shell_config]).and_return(@client)
@session.json_configuration = json_attribs
@session.send(:rebuild_node)
diff --git a/spec/unit/version_class_spec.rb b/spec/unit/version_class_spec.rb
index 5543fbe3c7..9dc981bd4c 100644
--- a/spec/unit/version_class_spec.rb
+++ b/spec/unit/version_class_spec.rb
@@ -162,7 +162,7 @@ describe Chef::Version do
].each do |spec|
it "(#{spec.first(3).join(' ')}) should be #{spec[3]}" do
got = Chef::Version.new(spec[0]).send(spec[1],
- Chef::Version.new(spec[2]))
+ Chef::Version.new(spec[2]))
expect(got).to eq(spec[3])
end
end