diff options
| author | Jack Nagel | 2014-06-10 20:24:07 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-06-10 20:24:07 -0500 |
| commit | 678c71c67b862cc41eb58b0b98d44f0efa80e161 (patch) | |
| tree | 4009c8dec81edbc37948ce8948d2df2cae3ad066 /Library/Homebrew | |
| parent | 0dc018c94cf10eb8151ee20c53964c176af4a779 (diff) | |
| download | homebrew-678c71c67b862cc41eb58b0b98d44f0efa80e161.tar.bz2 | |
Extract constant strings
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/test/test_patching.rb | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Library/Homebrew/test/test_patching.rb b/Library/Homebrew/test/test_patching.rb index a82a8092a..285094ad5 100644 --- a/Library/Homebrew/test/test_patching.rb +++ b/Library/Homebrew/test/test_patching.rb @@ -3,6 +3,9 @@ require 'formula' require 'testball' class PatchingTests < Test::Unit::TestCase + PATCH_URL_A = "file:///#{TEST_FOLDER}/patches/noop-a.diff" + PATCH_URL_B = "file:///#{TEST_FOLDER}/patches/noop-b.diff" + def formula(&block) super do url "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz" @@ -21,7 +24,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do def patches - "file:///#{TEST_FOLDER}/patches/noop-a.diff" + PATCH_URL_A end end.brew { assert_patched 'libexec/NOOP' } end @@ -31,7 +34,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do patch do - url "file:///#{TEST_FOLDER}/patches/noop-a.diff" + url PATCH_URL_A sha1 "fa8af2e803892e523fdedc6b758117c45e5749a2" end end.brew { assert_patched 'libexec/NOOP' } @@ -42,7 +45,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do patch :p1 do - url "file:///#{TEST_FOLDER}/patches/noop-a.diff" + url PATCH_URL_A sha1 "fa8af2e803892e523fdedc6b758117c45e5749a2" end end.brew { assert_patched 'libexec/NOOP' } @@ -54,7 +57,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do patch :p0 do - url "file:///#{TEST_FOLDER}/patches/noop-a.diff" + url PATCH_URL_A sha1 "fa8af2e803892e523fdedc6b758117c45e5749a2" end end.brew { } @@ -66,7 +69,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do patch :p0 do - url "file:///#{TEST_FOLDER}/patches/noop-b.diff" + url PATCH_URL_B sha1 "3b54bd576f998ef6d6623705ee023b55062b9504" end end.brew { assert_patched 'libexec/NOOP' } @@ -77,7 +80,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do def patches - { :p0 => "file:///#{TEST_FOLDER}/patches/noop-b.diff" } + { :p0 => PATCH_URL_B } end end.brew { assert_patched 'libexec/NOOP' } end @@ -87,7 +90,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do def patches - ["file:///#{TEST_FOLDER}/patches/noop-a.diff"] + [PATCH_URL_A] end end.brew { assert_patched 'libexec/noop' } end @@ -97,7 +100,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do def patches - { :p1 => "file:///#{TEST_FOLDER}/patches/noop-a.diff" } + { :p1 => PATCH_URL_A } end end.brew { assert_patched 'libexec/noop' } end @@ -107,7 +110,7 @@ class PatchingTests < Test::Unit::TestCase shutup do formula do def patches - { :p1 => ["file:///#{TEST_FOLDER}/patches/noop-a.diff"] } + { :p1 => [PATCH_URL_A] } end end.brew { assert_patched 'libexec/noop' } end |
