Extract constant strings
This commit is contained in:
parent
df7756aeb9
commit
c7685d2b70
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user