Stop exposing combined options from the tab
This commit is contained in:
parent
e0f86a1a86
commit
ca3c727267
@ -82,13 +82,7 @@ class Tab < OpenStruct
|
|||||||
end
|
end
|
||||||
|
|
||||||
def with? name
|
def with? name
|
||||||
if options.include? "with-#{name}"
|
include?("with-#{name}") || unused_options.include?("without-#{name}")
|
||||||
include? "with-#{name}"
|
|
||||||
elsif options.include? "without-#{name}"
|
|
||||||
not include? "without-#{name}"
|
|
||||||
else
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def without? name
|
def without? name
|
||||||
@ -119,10 +113,6 @@ class Tab < OpenStruct
|
|||||||
Options.coerce(super)
|
Options.coerce(super)
|
||||||
end
|
end
|
||||||
|
|
||||||
def options
|
|
||||||
used_options + unused_options
|
|
||||||
end
|
|
||||||
|
|
||||||
def cxxstdlib
|
def cxxstdlib
|
||||||
# Older tabs won't have these values, so provide sensible defaults
|
# Older tabs won't have these values, so provide sensible defaults
|
||||||
lib = stdlib.to_sym if stdlib
|
lib = stdlib.to_sym if stdlib
|
||||||
|
|||||||
@ -25,7 +25,6 @@ class TabTests < Homebrew::TestCase
|
|||||||
tab = Tab.dummy_tab
|
tab = Tab.dummy_tab
|
||||||
assert_empty tab.unused_options
|
assert_empty tab.unused_options
|
||||||
assert_empty tab.used_options
|
assert_empty tab.used_options
|
||||||
assert_empty tab.options
|
|
||||||
refute_predicate tab, :built_as_bottle
|
refute_predicate tab, :built_as_bottle
|
||||||
refute_predicate tab, :poured_from_bottle
|
refute_predicate tab, :poured_from_bottle
|
||||||
assert_empty tab.tapped_from
|
assert_empty tab.tapped_from
|
||||||
@ -52,10 +51,6 @@ class TabTests < Homebrew::TestCase
|
|||||||
assert_predicate tab, :universal?
|
assert_predicate tab, :universal?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_options
|
|
||||||
assert_equal (@used + @unused).sort, @tab.options.sort
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_cxxstdlib
|
def test_cxxstdlib
|
||||||
assert_equal :clang, @tab.cxxstdlib.compiler
|
assert_equal :clang, @tab.cxxstdlib.compiler
|
||||||
assert_equal :libcxx, @tab.cxxstdlib.type
|
assert_equal :libcxx, @tab.cxxstdlib.type
|
||||||
@ -75,7 +70,6 @@ class TabTests < Homebrew::TestCase
|
|||||||
|
|
||||||
assert_equal @used.sort, tab.used_options.sort
|
assert_equal @used.sort, tab.used_options.sort
|
||||||
assert_equal @unused.sort, tab.unused_options.sort
|
assert_equal @unused.sort, tab.unused_options.sort
|
||||||
assert_equal (@used + @unused).sort, tab.options.sort
|
|
||||||
refute_predicate tab, :built_as_bottle
|
refute_predicate tab, :built_as_bottle
|
||||||
assert_predicate tab, :poured_from_bottle
|
assert_predicate tab, :poured_from_bottle
|
||||||
assert_equal "Homebrew/homebrew", tab.tapped_from
|
assert_equal "Homebrew/homebrew", tab.tapped_from
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user