aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_patch.rb
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-12-19 11:54:53 +0100
committerBaptiste Fontaine2015-12-20 12:11:40 +0100
commita6d2723ef532dc576968f6f9e155c165e47f26b2 (patch)
tree46cff38bb79e50f6533ceceb83e19e5f9b865385 /Library/Homebrew/test/test_patch.rb
parentf25894981663ba20596483d8391be232226a4954 (diff)
downloadbrew-a6d2723ef532dc576968f6f9e155c165e47f26b2.tar.bz2
more core unit tests
Closes Homebrew/homebrew#47182. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew/test/test_patch.rb')
-rw-r--r--Library/Homebrew/test/test_patch.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_patch.rb b/Library/Homebrew/test/test_patch.rb
index 214955ef1..4aa1a1623 100644
--- a/Library/Homebrew/test/test_patch.rb
+++ b/Library/Homebrew/test/test_patch.rb
@@ -35,6 +35,7 @@ class PatchTests < Homebrew::TestCase
def test_raises_for_unknown_values
assert_raises(ArgumentError) { Patch.create(Object.new) }
+ assert_raises(ArgumentError) { Patch.create(Object.new, Object.new) }
end
end
@@ -100,3 +101,25 @@ class LegacyPatchTests < Homebrew::TestCase
assert_empty Patch.normalize_legacy_patches(nil)
end
end
+
+class EmbeddedPatchTests < Homebrew::TestCase
+ def test_inspect
+ p = EmbeddedPatch.new :p1
+ assert_equal "#<EmbeddedPatch: :p1>", p.inspect
+ end
+end
+
+class ExternalPatchTests < Homebrew::TestCase
+ def setup
+ @p = ExternalPatch.new(:p1) { url "file:///my.patch" }
+
+ end
+
+ def test_url
+ assert_equal "file:///my.patch", @p.url
+ end
+
+ def test_inspect
+ assert_equal %(#<ExternalPatch: :p1 "file:///my.patch">), @p.inspect
+ end
+end