diff options
| author | Jack Nagel | 2014-07-29 16:06:06 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-29 16:06:06 -0500 |
| commit | e0c97177170f1238c53d0b9ecca8dd97bf74c03e (patch) | |
| tree | e888bdb0afa4eecb5ba5fa44f11213b144f13454 /Library/Homebrew/test/test_patching.rb | |
| parent | fbee511eba85fdd5808d1750468c751b9327c787 (diff) | |
| download | brew-e0c97177170f1238c53d0b9ecca8dd97bf74c03e.tar.bz2 | |
Store test patches in constants
Diffstat (limited to 'Library/Homebrew/test/test_patching.rb')
| -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 |
