From 97cfef7bdf6448b342deec6825f945d6cfb55e7d Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 10 Jul 2018 09:35:36 -0700 Subject: Attribute -> Property in additional places Specs and comments, but we should get it right in those places as well Signed-off-by: Tim Smith --- .../guard_interpreter/resource_guard_interpreter.rb | 2 +- lib/chef/provider/windows_task.rb | 2 +- lib/chef/resource/script.rb | 2 +- lib/chef/resource/service.rb | 2 +- spec/functional/resource/bash_spec.rb | 2 +- spec/unit/provider/execute_spec.rb | 2 +- spec/unit/resource/dsc_script_spec.rb | 20 ++++++++++---------- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/chef/guard_interpreter/resource_guard_interpreter.rb b/lib/chef/guard_interpreter/resource_guard_interpreter.rb index b1d497181b..79134d3dfb 100644 --- a/lib/chef/guard_interpreter/resource_guard_interpreter.rb +++ b/lib/chef/guard_interpreter/resource_guard_interpreter.rb @@ -36,7 +36,7 @@ class Chef # Only execute and script resources and use guard attributes. # The command to be executed on them are passed via different attributes. # Script resources use code attribute and execute resources use - # command attribute. Moreover script resources are also execute + # command property. Moreover script resources are also execute # resources. Here we make sure @command is assigned to the right # attribute by checking the type of the resources. # We need to make sure we check for Script first because any resource diff --git a/lib/chef/provider/windows_task.rb b/lib/chef/provider/windows_task.rb index f10e4adb70..4fb4817020 100644 --- a/lib/chef/provider/windows_task.rb +++ b/lib/chef/provider/windows_task.rb @@ -563,7 +563,7 @@ class Chef new_resource.password.nil? ? TaskScheduler::TASK_LOGON_SERVICE_ACCOUNT : TaskScheduler::TASK_LOGON_PASSWORD end - # This method checks if task and command attributes exist since those two are mandatory attributes to create a schedules task. + # This method checks if task and command properties exist since those two are mandatory properties to create a schedules task. def basic_validation validate = [] validate << "Command" if new_resource.command.nil? || new_resource.command.empty? diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb index 35d73a61dc..ac3af619e5 100644 --- a/lib/chef/resource/script.rb +++ b/lib/chef/resource/script.rb @@ -40,7 +40,7 @@ class Chef # FIXME: remove this and use an execute sub-resource instead of inheriting from Execute def command(arg = nil) unless arg.nil? - raise Chef::Exceptions::Script, "Do not use the command attribute on a #{resource_name} resource, use the 'code' property instead." + raise Chef::Exceptions::Script, "Do not use the command property on a #{resource_name} resource, use the 'code' property instead." end super end diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb index fe13c433cb..c5197d5f06 100644 --- a/lib/chef/resource/service.rb +++ b/lib/chef/resource/service.rb @@ -123,7 +123,7 @@ class Chef # distributions this is '/etc/init.d/SERVICE_NAME' by default. In # non-standard configurations setting this value will save having to # specify overrides for the start_command, stop_command and - # restart_command attributes. + # restart_command properties. def init_command(arg = nil) set_or_return( :init_command, diff --git a/spec/functional/resource/bash_spec.rb b/spec/functional/resource/bash_spec.rb index 4a5fee64bc..969ed8f605 100644 --- a/spec/functional/resource/bash_spec.rb +++ b/spec/functional/resource/bash_spec.rb @@ -27,7 +27,7 @@ describe Chef::Resource::Bash, :unix_only do resource end - describe "when setting the command attribute" do + describe "when setting the command property" do let (:command) { "wizard racket" } it "should raise an exception when trying to set the command" do diff --git a/spec/unit/provider/execute_spec.rb b/spec/unit/provider/execute_spec.rb index 48cee78462..622d54af37 100644 --- a/spec/unit/provider/execute_spec.rb +++ b/spec/unit/provider/execute_spec.rb @@ -102,7 +102,7 @@ describe Chef::Provider::Execute do expect(new_resource).to be_updated end - it "if you pass a command attribute, it runs the command" do + it "if you pass a command property, it runs the command" do new_resource.command "/usr/argelbargle/bin/oogachacka 12345" expect(provider).to receive(:shell_out!).with(new_resource.command, opts) expect(provider).to receive(:converge_by).with("execute #{new_resource.command}").and_call_original diff --git a/spec/unit/resource/dsc_script_spec.rb b/spec/unit/resource/dsc_script_spec.rb index d5ebcaca5c..26a1c7cca0 100644 --- a/spec/unit/resource/dsc_script_spec.rb +++ b/spec/unit/resource/dsc_script_spec.rb @@ -45,27 +45,27 @@ describe Chef::Resource::DscScript do expect { resource.action :run }.not_to raise_error end - it "allows the code attribute to be set" do + it "allows the code property to be set" do resource.code(configuration_code) expect(resource.code).to eq(configuration_code) end - it "allows the command attribute to be set" do + it "allows the command property to be set" do resource.command(configuration_path) expect(resource.command).to eq(configuration_path) end - it "allows the configuration_name attribute to be set" do + it "allows the configuration_name property to be set" do resource.configuration_name(configuration_name) expect(resource.configuration_name).to eq(configuration_name) end - it "allows the configuration_data attribute to be set" do + it "allows the configuration_data property to be set" do resource.configuration_data(configuration_data) expect(resource.configuration_data).to eq(configuration_data) end - it "allows the configuration_data_script attribute to be set" do + it "allows the configuration_data_script property to be set" do resource.configuration_data_script(configuration_data_script) expect(resource.configuration_data_script).to eq(configuration_data_script) end @@ -106,27 +106,27 @@ describe Chef::Resource::DscScript do end end - it "raises an ArgumentError exception if an attempt is made to set the code attribute when the command attribute is already set" do + it "raises an ArgumentError exception if an attempt is made to set the code property when the command property is already set" do resource.command(configuration_path) expect { resource.code(configuration_code) }.to raise_error(ArgumentError) end - it "raises an ArgumentError exception if an attempt is made to set the command attribute when the code attribute is already set" do + it "raises an ArgumentError exception if an attempt is made to set the command property when the code property is already set" do resource.code(configuration_code) expect { resource.command(configuration_path) }.to raise_error(ArgumentError) end - it "raises an ArgumentError exception if an attempt is made to set the configuration_name attribute when the code attribute is already set" do + it "raises an ArgumentError exception if an attempt is made to set the configuration_name property when the code property is already set" do resource.code(configuration_code) expect { resource.configuration_name(configuration_name) }.to raise_error(ArgumentError) end - it "raises an ArgumentError exception if an attempt is made to set the configuration_data attribute when the configuration_data_script attribute is already set" do + it "raises an ArgumentError exception if an attempt is made to set the configuration_data property when the configuration_data_script property is already set" do resource.configuration_data_script(configuration_data_script) expect { resource.configuration_data(configuration_data) }.to raise_error(ArgumentError) end - it "raises an ArgumentError exception if an attempt is made to set the configuration_data_script attribute when the configuration_data attribute is already set" do + it "raises an ArgumentError exception if an attempt is made to set the configuration_data_script property when the configuration_data property is already set" do resource.configuration_data(configuration_data) expect { resource.configuration_data_script(configuration_data_script) }.to raise_error(ArgumentError) end -- cgit v1.2.1