diff options
| author | Mike McQuaid | 2018-01-22 09:44:32 +0000 |
|---|---|---|
| committer | GitHub | 2018-01-22 09:44:32 +0000 |
| commit | ace2d569dcd3a45d0fc49a6742540b6f7a957fbc (patch) | |
| tree | 3f0d03e347de345b64e1549d1812835c752ba992 /Library/Homebrew/test/patching_spec.rb | |
| parent | 97f0ef4c49d0f2f2a62a82e7ca21945d7cbe2c7c (diff) | |
| parent | 69db925e8a8030840d832c0b05cf29c3adc875dd (diff) | |
| download | brew-ace2d569dcd3a45d0fc49a6742540b6f7a957fbc.tar.bz2 | |
Merge pull request #3714 from ilovezfs/resource-patches1.5.1
resource: allow patches to be applied
Diffstat (limited to 'Library/Homebrew/test/patching_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/patching_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Library/Homebrew/test/patching_spec.rb b/Library/Homebrew/test/patching_spec.rb index 502f6204c..05aea1c70 100644 --- a/Library/Homebrew/test/patching_spec.rb +++ b/Library/Homebrew/test/patching_spec.rb @@ -30,6 +30,17 @@ describe "patching" do end end + matcher :have_its_resource_patched do + match do |formula| + formula.brew do + formula.resources.first.stage Pathname.pwd/"resource_dir" + s = File.read("resource_dir/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| formula.brew do @@ -73,6 +84,22 @@ describe "patching" do ).to be_patched end + specify "single_patch_dsl_for_resource" do + expect( + formula do + resource "some_resource" do + url TESTBALL_URL + sha256 TESTBALL_SHA256 + + patch do + url PATCH_URL_A + sha256 PATCH_A_SHA256 + end + end + end, + ).to have_its_resource_patched + end + specify "single_patch_dsl_with_apply" do expect( formula do |
