Skip to content
Snippets Groups Projects
Unverified Commit b62a2c7e authored by Xu Cheng's avatar Xu Cheng
Browse files

add more test


Closes #514.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent 30bbb93f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment