From 621caccc151dfbdddb29adfec57aef91ff3d06c5 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 18 Aug 2020 16:20:28 -0700 Subject: Make sure to not raise too early Signed-off-by: Tim Smith --- lib/chef/resource/timezone.rb | 2 +- spec/unit/resource/timezone_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/chef/resource/timezone.rb b/lib/chef/resource/timezone.rb index 97aa738af9..7ed67860cd 100644 --- a/lib/chef/resource/timezone.rb +++ b/lib/chef/resource/timezone.rb @@ -74,7 +74,7 @@ class Chef # @since 14.7 # @return [String] timezone id def current_windows_tz - tz_shellout = shell_out!("tzutil /g") + tz_shellout = shell_out("tzutil /g") raise "There was an error running the tzutil command" if tz_shellout.exitstatus == 1 tz_shellout.stdout.strip diff --git a/spec/unit/resource/timezone_spec.rb b/spec/unit/resource/timezone_spec.rb index 8ba033f072..b48a69e103 100644 --- a/spec/unit/resource/timezone_spec.rb +++ b/spec/unit/resource/timezone_spec.rb @@ -21,7 +21,7 @@ describe Chef::Resource::Timezone do let(:resource) { Chef::Resource::Timezone.new("fakey_fakerton") } let(:shellout_tzutil) do - double("shell_out!", stdout: "UTC\n", exitstatus: 0, error?: false) + double("shell_out", stdout: "UTC\n", exitstatus: 0, error?: false) end # note: This weird indention is correct @@ -87,7 +87,7 @@ systemd-timesyncd.service active: yes describe "#current_windows_tz?" do it "returns the TZ" do - expect(resource).to receive(:shell_out!).and_return(shellout_tzutil) + expect(resource).to receive(:shell_out).and_return(shellout_tzutil) expect(resource.current_windows_tz).to eql("UTC") end end -- cgit v1.2.1