Stop exposing defined options from the build object
This commit is contained in:
parent
8beb85a7fc
commit
161778f0f4
@ -1,8 +1,6 @@
|
|||||||
require 'options'
|
require 'options'
|
||||||
|
|
||||||
class BuildOptions
|
class BuildOptions
|
||||||
include Enumerable
|
|
||||||
|
|
||||||
attr_accessor :args
|
attr_accessor :args
|
||||||
attr_accessor :universal
|
attr_accessor :universal
|
||||||
|
|
||||||
@ -16,18 +14,6 @@ class BuildOptions
|
|||||||
@args = other.args.dup
|
@args = other.args.dup
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty?
|
|
||||||
@options.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def each(*args, &block)
|
|
||||||
@options.each(*args, &block)
|
|
||||||
end
|
|
||||||
|
|
||||||
def as_flags
|
|
||||||
@options.as_flags
|
|
||||||
end
|
|
||||||
|
|
||||||
def include? name
|
def include? name
|
||||||
args.include? '--' + name
|
args.include? '--' + name
|
||||||
end
|
end
|
||||||
|
|||||||
@ -10,11 +10,6 @@ class BuildOptionsTests < Homebrew::TestCase
|
|||||||
@build = BuildOptions.new(args, opts)
|
@build = BuildOptions.new(args, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_as_flags
|
|
||||||
assert_equal %w{--with-foo --with-bar --without-baz --without-qux}.sort,
|
|
||||||
@build.as_flags.sort
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_include
|
def test_include
|
||||||
assert_includes @build, "with-foo"
|
assert_includes @build, "with-foo"
|
||||||
refute_includes @build, "with-qux"
|
refute_includes @build, "with-qux"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user