aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2016-07-15 15:16:55 +0800
committerXu Cheng2016-07-15 19:57:23 +0800
commitb62a2c7e7f9fc7f45931b61d7a534a6d6b02f391 (patch)
treeab3088777a4f56172593248a94ce5f113e0f931c /Library
parent30bbb93f2189be88c799bfdb257216909bcd3fde (diff)
downloadbrew-b62a2c7e7f9fc7f45931b61d7a534a6d6b02f391.tar.bz2
add more test
Closes #514. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_formulary.rb9
-rw-r--r--Library/Homebrew/test/test_tab.rb9
2 files changed, 16 insertions, 2 deletions
diff --git a/Library/Homebrew/test/test_formulary.rb b/Library/Homebrew/test/test_formulary.rb
index 593e08cfa..056fd8c8d 100644
--- a/Library/Homebrew/test/test_formulary.rb
+++ b/Library/Homebrew/test/test_formulary.rb
@@ -90,12 +90,17 @@ class FormularyFactoryTest < Homebrew::TestCase
alias_dir.rmtree
end
- def test_factory_from_rack
+ def test_factory_from_rack_and_from_keg
formula = Formulary.factory(@path)
installer = FormulaInstaller.new(formula)
shutup { installer.install }
keg = Keg.new(formula.prefix)
- assert_kind_of Formula, Formulary.from_rack(formula.rack)
+ f = Formulary.from_rack(formula.rack)
+ assert_kind_of Formula, f
+ assert_kind_of Tab, f.build
+ f = Formulary.from_keg(keg)
+ assert_kind_of Formula, f
+ assert_kind_of Tab, f.build
ensure
keg.unlink
keg.uninstall
diff --git a/Library/Homebrew/test/test_tab.rb b/Library/Homebrew/test/test_tab.rb
index ce644b7c2..63f537557 100644
--- a/Library/Homebrew/test/test_tab.rb
+++ b/Library/Homebrew/test/test_tab.rb
@@ -29,6 +29,9 @@ class TabTests < Homebrew::TestCase
assert_empty tab.used_options
refute_predicate tab, :built_as_bottle
refute_predicate tab, :poured_from_bottle
+ assert_predicate tab, :stable?
+ refute_predicate tab, :devel?
+ refute_predicate tab, :head?
assert_nil tab.tap
assert_nil tab.time
assert_nil tab.HEAD
@@ -74,6 +77,9 @@ class TabTests < Homebrew::TestCase
assert_equal @unused.sort, tab.unused_options.sort
refute_predicate tab, :built_as_bottle
assert_predicate tab, :poured_from_bottle
+ assert_predicate tab, :stable?
+ refute_predicate tab, :devel?
+ refute_predicate tab, :head?
assert_equal "homebrew/core", tab.tap.name
assert_equal :stable, tab.spec
refute_nil tab.time
@@ -90,6 +96,9 @@ class TabTests < Homebrew::TestCase
assert_equal @unused.sort, tab.unused_options.sort
refute_predicate tab, :built_as_bottle
assert_predicate tab, :poured_from_bottle
+ assert_predicate tab, :stable?
+ refute_predicate tab, :devel?
+ refute_predicate tab, :head?
assert_equal "homebrew/core", tab.tap.name
assert_equal :stable, tab.spec
refute_nil tab.time