From 847897fdac65882bbea15600f2806a8071ec01e8 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 13 Jan 2021 11:21:10 -0800 Subject: [PATCH] Popen spec: ensure Rubocop is happy These were introduced in #10305 but only started going red after that PR was merged. --- Library/Homebrew/test/utils/popen_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/test/utils/popen_spec.rb b/Library/Homebrew/test/utils/popen_spec.rb index ff4f366a7c..9dcac24180 100644 --- a/Library/Homebrew/test/utils/popen_spec.rb +++ b/Library/Homebrew/test/utils/popen_spec.rb @@ -75,12 +75,12 @@ describe Utils do describe "::safe_popen_read" do it "does not raise an error if the command succeeds" do - expect(subject.safe_popen_read("sh", "-c", "true")).to eq("") + expect(described_class.safe_popen_read("sh", "-c", "true")).to eq("") expect($CHILD_STATUS).to be_a_success end it "raises an error if the command fails" do - expect { subject.safe_popen_read("sh", "-c", "false") }.to raise_error(ErrorDuringExecution) + expect { described_class.safe_popen_read("sh", "-c", "false") }.to raise_error(ErrorDuringExecution) expect($CHILD_STATUS).to be_a_failure end end @@ -88,14 +88,14 @@ describe Utils do describe "::safe_popen_write" do it "does not raise an error if the command succeeds" do expect( - subject.safe_popen_write("grep", "success") { |pipe| pipe.write "success\n" }.chomp, + described_class.safe_popen_write("grep", "success") { |pipe| pipe.write "success\n" }.chomp, ).to eq("success") expect($CHILD_STATUS).to be_a_success end it "raises an error if the command fails" do expect { - subject.safe_popen_write("grep", "success") { |pipe| pipe.write "failure\n" } + described_class.safe_popen_write("grep", "success") { |pipe| pipe.write "failure\n" } }.to raise_error(ErrorDuringExecution) expect($CHILD_STATUS).to be_a_failure end