diff options
| author | Jack Nagel | 2014-07-29 16:06:06 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-07-29 16:22:06 -0500 | 
| commit | f3cb1d2b0614e3dcfe2e2911e65bfd24511a2fc2 (patch) | |
| tree | 105313ca7fe29c085cfcb782814af69b5f2fc896 /Library/Homebrew/test | |
| parent | 1d039ebf2bd9e3fb7b1f753f616fe0a5f8bcba3b (diff) | |
| download | homebrew-f3cb1d2b0614e3dcfe2e2911e65bfd24511a2fc2.tar.bz2 | |
Decouple DATA patches from the executing script
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_patch.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_patching.rb | 24 | 
2 files changed, 25 insertions, 3 deletions
| diff --git a/Library/Homebrew/test/test_patch.rb b/Library/Homebrew/test/test_patch.rb index bc0e522d3..4b8cdf53c 100644 --- a/Library/Homebrew/test/test_patch.rb +++ b/Library/Homebrew/test/test_patch.rb @@ -36,13 +36,13 @@ class PatchTests < Homebrew::TestCase    def test_create_DATA      patch = Patch.create(:p0, :DATA) -    assert_kind_of IOPatch, patch +    assert_kind_of DATAPatch, patch      assert_equal :p0, patch.strip    end    def test_create_DATA_without_strip      patch = Patch.create(:DATA, nil) -    assert_kind_of IOPatch, patch +    assert_kind_of DATAPatch, patch      assert_equal :p1, patch.strip    end diff --git a/Library/Homebrew/test/test_patching.rb b/Library/Homebrew/test/test_patching.rb index 8fe8489f2..76ed37483 100644 --- a/Library/Homebrew/test/test_patching.rb +++ b/Library/Homebrew/test/test_patching.rb @@ -8,7 +8,7 @@ class PatchingTests < Homebrew::TestCase    PATCH_A_CONTENTS = File.read "#{TEST_DIRECTORY}/patches/noop-a.diff"    PATCH_B_CONTENTS = File.read "#{TEST_DIRECTORY}/patches/noop-b.diff" -  def formula(&block) +  def formula(*args, &block)      super do        url "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"        sha1 "482e737739d946b7c8cbaf127d9ee9c148b999f5" @@ -138,4 +138,26 @@ class PatchingTests < Homebrew::TestCase        end.brew { assert_patched 'libexec/noop' }      end    end + +  def test_patch_DATA_constant +    shutup do +      formula("test", Pathname.new(__FILE__).expand_path) do +        def patches +          Formula::DATA +        end +      end.brew { assert_patched "libexec/noop" } +    end +  end  end + +__END__ +diff --git a/libexec/NOOP b/libexec/NOOP +index bfdda4c..e08d8f4 100755 +--- a/libexec/NOOP ++++ b/libexec/NOOP +@@ -1,2 +1,2 @@ + #!/bin/bash +-echo NOOP +\ No newline at end of file ++echo ABCD +\ No newline at end of file | 
