From a6d2723ef532dc576968f6f9e155c165e47f26b2 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Sat, 19 Dec 2015 11:54:53 +0100 Subject: more core unit tests Closes Homebrew/homebrew#47182. Signed-off-by: Baptiste Fontaine --- Library/Homebrew/test/test_patch.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Library/Homebrew/test/test_patch.rb') 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 "#", 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 %(#), @p.inspect + end +end -- cgit v1.2.3