diff options
Diffstat (limited to 'Library/Homebrew/test/patching_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/patching_spec.rb | 78 |
1 files changed, 33 insertions, 45 deletions
diff --git a/Library/Homebrew/test/patching_spec.rb b/Library/Homebrew/test/patching_spec.rb index dd849ca92..502f6204c 100644 --- a/Library/Homebrew/test/patching_spec.rb +++ b/Library/Homebrew/test/patching_spec.rb @@ -21,27 +21,23 @@ describe "patching" do matcher :be_patched do match do |formula| - shutup do - formula.brew do - formula.patch - s = File.read("libexec/NOOP") - expect(s).not_to include("NOOP"), "libexec/NOOP was not patched as expected" - expect(s).to include("ABCD"), "libexec/NOOP was not patched as expected" - end + formula.brew do + formula.patch + s = File.read("libexec/NOOP") + expect(s).not_to include("NOOP"), "libexec/NOOP was not patched as expected" + expect(s).to include("ABCD"), "libexec/NOOP was not patched as expected" end end end matcher :be_sequentially_patched do match do |formula| - shutup do - formula.brew do - formula.patch - s = File.read("libexec/NOOP") - expect(s).not_to include("NOOP"), "libexec/NOOP was not patched as expected" - expect(s).not_to include("ABCD"), "libexec/NOOP was not patched as expected" - expect(s).to include("1234"), "libexec/NOOP was not patched as expected" - end + formula.brew do + formula.patch + s = File.read("libexec/NOOP") + expect(s).not_to include("NOOP"), "libexec/NOOP was not patched as expected" + expect(s).not_to include("ABCD"), "libexec/NOOP was not patched as expected" + expect(s).to include("1234"), "libexec/NOOP was not patched as expected" end end end @@ -49,10 +45,8 @@ describe "patching" do matcher :miss_apply do match do |formula| expect { - shutup do - formula.brew do - formula.patch - end + formula.brew do + formula.patch end }.to raise_error(MissingApplyError) end @@ -128,32 +122,28 @@ describe "patching" do specify "single_patch_dsl_with_incorrect_strip" do expect { - shutup do - f = formula do - patch :p0 do - url PATCH_URL_A - sha256 PATCH_A_SHA256 - end + f = formula do + patch :p0 do + url PATCH_URL_A + sha256 PATCH_A_SHA256 end - - f.brew { |formula, _staging| formula.patch } end + + f.brew { |formula, _staging| formula.patch } }.to raise_error(ErrorDuringExecution) end specify "single_patch_dsl_with_incorrect_strip_with_apply" do expect { - shutup do - f = formula do - patch :p0 do - url TESTBALL_PATCHES_URL - sha256 TESTBALL_PATCHES_SHA256 - apply APPLY_A - end + f = formula do + patch :p0 do + url TESTBALL_PATCHES_URL + sha256 TESTBALL_PATCHES_SHA256 + apply APPLY_A end - - f.brew { |formula, _staging| formula.patch } end + + f.brew { |formula, _staging| formula.patch } }.to raise_error(ErrorDuringExecution) end @@ -261,17 +251,15 @@ describe "patching" do specify "single_patch_dsl_with_apply_enoent_fail" do expect { - shutup do - f = formula do - patch do - url TESTBALL_PATCHES_URL - sha256 TESTBALL_PATCHES_SHA256 - apply "patches/#{APPLY_A}" - end + f = formula do + patch do + url TESTBALL_PATCHES_URL + sha256 TESTBALL_PATCHES_SHA256 + apply "patches/#{APPLY_A}" end - - f.brew { |formula, _staging| formula.patch } end + + f.brew { |formula, _staging| formula.patch } }.to raise_error(ErrorDuringExecution) end end |
