test_dependency: add failing option names test.
This test will obviously fail but it does mark that the option names are not being merged correctly.
This commit is contained in:
parent
7095378b31
commit
484c70d19f
@ -39,6 +39,25 @@ class DependencyTests < Homebrew::TestCase
|
||||
assert_equal [:build, "bar"], dep.tags
|
||||
end
|
||||
|
||||
def test_merge_repeats
|
||||
dep = Dependency.new("foo", [:build], nil, "foo")
|
||||
dep2 = Dependency.new("foo", ["bar"], nil, "foo2")
|
||||
dep3 = Dependency.new("xyz", ["abc"], nil, "foo")
|
||||
merged = Dependency.merge_repeats([dep, dep2, dep3])
|
||||
assert_equal 2, merged.length
|
||||
assert_equal Dependency, merged.first.class
|
||||
|
||||
foo_named_dep = merged.find {|d| d.name == "foo"}
|
||||
assert_equal [:build, "bar"], foo_named_dep.tags
|
||||
assert_includes foo_named_dep.option_name, "foo"
|
||||
assert_includes foo_named_dep.option_name, "foo2"
|
||||
|
||||
xyz_named_dep = merged.find {|d| d.name == "xyz"}
|
||||
assert_equal ["abc"], xyz_named_dep.tags
|
||||
assert_includes xyz_named_dep.option_name, "foo"
|
||||
refute_includes xyz_named_dep.option_name, "foo2"
|
||||
end
|
||||
|
||||
def test_equality
|
||||
foo1 = Dependency.new("foo")
|
||||
foo2 = Dependency.new("foo")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user