tests: rely on fewer implementation details
These tests were using too much semi-global state (instance variables) and relied unnecessarily on the exact number of calls to `optional?` and `recommended?` in the `Depedable` module.
This commit is contained in:
parent
6d802d8087
commit
10f066197e
@ -48,15 +48,15 @@ class DependencyExpansionTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_expand_skips_optionals_by_default
|
def test_expand_skips_optionals_by_default
|
||||||
@foo.expects(:optional?).returns(true)
|
deps = [build_dep(:foo, [:optional]), @bar, @baz, @qux]
|
||||||
@f = stub(:deps => @deps, :build => stub(:with? => false), :name => "f")
|
f = stub(:deps => deps, :build => stub(:with? => false), :name => "f")
|
||||||
assert_equal [@bar, @baz, @qux], Dependency.expand(@f)
|
assert_equal [@bar, @baz, @qux], Dependency.expand(f)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_expand_keeps_recommendeds_by_default
|
def test_expand_keeps_recommendeds_by_default
|
||||||
@foo.expects(:recommended?).returns(true)
|
deps = [build_dep(:foo, [:recommended]), @bar, @baz, @qux]
|
||||||
@f = stub(:deps => @deps, :build => stub(:with? => true), :name => "f")
|
f = stub(:deps => deps, :build => stub(:with? => true), :name => "f")
|
||||||
assert_equal @deps, Dependency.expand(@f)
|
assert_equal deps, Dependency.expand(f)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_merges_repeated_deps_with_differing_options
|
def test_merges_repeated_deps_with_differing_options
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user