diff options
| author | Jack Nagel | 2014-07-29 16:06:06 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-07-29 16:06:06 -0500 | 
| commit | 1d039ebf2bd9e3fb7b1f753f616fe0a5f8bcba3b (patch) | |
| tree | d6e235615d38a2f98896bb76080d68e99daab334 | |
| parent | 896dad4fa82169f43613a0a393a64ec7d8087628 (diff) | |
| download | homebrew-1d039ebf2bd9e3fb7b1f753f616fe0a5f8bcba3b.tar.bz2 | |
Store test patches in constants
| -rw-r--r-- | Library/Homebrew/test/test_patching.rb | 28 | 
1 files changed, 4 insertions, 24 deletions
| diff --git a/Library/Homebrew/test/test_patching.rb b/Library/Homebrew/test/test_patching.rb index 9d9f95e1d..8fe8489f2 100644 --- a/Library/Homebrew/test/test_patching.rb +++ b/Library/Homebrew/test/test_patching.rb @@ -5,6 +5,8 @@ require 'testball'  class PatchingTests < Homebrew::TestCase    PATCH_URL_A = "file://#{TEST_DIRECTORY}/patches/noop-a.diff"    PATCH_URL_B = "file://#{TEST_DIRECTORY}/patches/noop-b.diff" +  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)      super do @@ -124,18 +126,7 @@ class PatchingTests < Homebrew::TestCase    def test_patch_string      shutup do        formula do -        patch %q{ -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 -} +        patch PATCH_A_CONTENTS        end.brew { assert_patched 'libexec/noop' }      end    end @@ -143,18 +134,7 @@ index bfdda4c..e08d8f4 100755    def test_patch_string_with_strip      shutup do        formula do -        patch :p0, %q{ -diff --git libexec/NOOP libexec/NOOP -index bfdda4c..e08d8f4 100755 ---- libexec/NOOP -+++ libexec/NOOP -@@ -1,2 +1,2 @@ - #!/bin/bash --echo NOOP -\ No newline at end of file -+echo ABCD -\ No newline at end of file -} +        patch :p0, PATCH_B_CONTENTS        end.brew { assert_patched 'libexec/noop' }      end    end | 
