diff options
Diffstat (limited to 'spec/unit/provider')
-rw-r--r-- | spec/unit/provider/mount/mount_spec.rb | 22 | ||||
-rw-r--r-- | spec/unit/provider/powershell_script_spec.rb | 20 | ||||
-rw-r--r-- | spec/unit/provider/service/windows_spec.rb | 16 |
3 files changed, 29 insertions, 29 deletions
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb index 866b548d4e..5e1ffbf208 100644 --- a/spec/unit/provider/mount/mount_spec.rb +++ b/spec/unit/provider/mount/mount_spec.rb @@ -67,18 +67,18 @@ describe Chef::Provider::Mount::Mount do describe "when dealing with network mounts" do { "nfs" => "nfsserver:/vol/path", "cifs" => "//cifsserver/share" }.each do |type, fs_spec| - it "should detect network fs_spec (#{type})" do - @new_resource.device fs_spec - expect(@provider.network_device?).to be_truthy + it "should detect network fs_spec (#{type})" do + @new_resource.device fs_spec + expect(@provider.network_device?).to be_truthy + end + + it "should ignore trailing slash and set mounted to true for network mount (#{type})" do + @new_resource.device fs_spec + allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: "#{fs_spec}/ on /tmp/foo type #{type} (rw)\n")) + @provider.load_current_resource + expect(@provider.current_resource.mounted).to be_truthy + end end - - it "should ignore trailing slash and set mounted to true for network mount (#{type})" do - @new_resource.device fs_spec - allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: "#{fs_spec}/ on /tmp/foo type #{type} (rw)\n")) - @provider.load_current_resource - expect(@provider.current_resource.mounted).to be_truthy - end - end end it "should raise an error if the mount device does not exist" do diff --git a/spec/unit/provider/powershell_script_spec.rb b/spec/unit/provider/powershell_script_spec.rb index 61c415f88d..a247c26651 100644 --- a/spec/unit/provider/powershell_script_spec.rb +++ b/spec/unit/provider/powershell_script_spec.rb @@ -107,19 +107,19 @@ describe Chef::Provider::PowershellScript, "action_run" do "3.6" => "Bypass", "4.0" => "Bypass", "5.0" => "Bypass" }.each do |version_policy| - let(:powershell_version) { version_policy[0].to_f } - context "when running PowerShell version #{version_policy[0]}" do let(:powershell_version) { version_policy[0].to_f } - - it "sets default -ExecutionPolicy flag to '#{version_policy[1]}'" do - expect(execution_policy_flag.downcase).to eq(version_policy[1].downcase) - end - it "sets user defined -ExecutionPolicy flag to 'RemoteSigned'" do - set_user_defined_flag - expect(execution_policy_flag.downcase).to eq("RemoteSigned".downcase) + context "when running PowerShell version #{version_policy[0]}" do + let(:powershell_version) { version_policy[0].to_f } + + it "sets default -ExecutionPolicy flag to '#{version_policy[1]}'" do + expect(execution_policy_flag.downcase).to eq(version_policy[1].downcase) + end + it "sets user defined -ExecutionPolicy flag to 'RemoteSigned'" do + set_user_defined_flag + expect(execution_policy_flag.downcase).to eq("RemoteSigned".downcase) + end end end - end end end end diff --git a/spec/unit/provider/service/windows_spec.rb b/spec/unit/provider/service/windows_spec.rb index 9145a0caf4..8cda32973e 100644 --- a/spec/unit/provider/service/windows_spec.rb +++ b/spec/unit/provider/service/windows_spec.rb @@ -357,14 +357,14 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl # properties that are Strings %i{binary_path_name load_order_group dependencies run_as_user display_name description}.each do |attr| - it "configures service if #{attr} has changed" do - provider.current_resource.send("#{attr}=", "old value") - provider.new_resource.send("#{attr}=", "new value") - - expect(Win32::Service).to receive(:configure) - provider.action_configure - end - end + it "configures service if #{attr} has changed" do + provider.current_resource.send("#{attr}=", "old value") + provider.new_resource.send("#{attr}=", "new value") + + expect(Win32::Service).to receive(:configure) + provider.action_configure + end + end # properties that are Integers %i{service_type error_control}.each do |attr| |