Always pass an Options instance to the BuildOptions constructor
This commit is contained in:
parent
a43f450544
commit
ecaf1592a0
@ -4,7 +4,7 @@ class BuildOptions
|
|||||||
attr_accessor :universal
|
attr_accessor :universal
|
||||||
|
|
||||||
def initialize(args, options)
|
def initialize(args, options)
|
||||||
@args = Options.coerce(args)
|
@args = args
|
||||||
@options = options
|
@options = options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class SoftwareSpec
|
|||||||
@bottle_specification = BottleSpecification.new
|
@bottle_specification = BottleSpecification.new
|
||||||
@patches = []
|
@patches = []
|
||||||
@options = Options.new
|
@options = Options.new
|
||||||
@build = BuildOptions.new(ARGV.options_only, options)
|
@build = BuildOptions.new(Options.coerce(ARGV.options_only), options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def owner= owner
|
def owner= owner
|
||||||
|
@ -3,10 +3,8 @@ require 'build_options'
|
|||||||
|
|
||||||
class BuildOptionsTests < Homebrew::TestCase
|
class BuildOptionsTests < Homebrew::TestCase
|
||||||
def setup
|
def setup
|
||||||
args = %w{--with-foo --with-bar --without-qux}
|
args = Options.coerce(%w(--with-foo --with-bar --without-qux))
|
||||||
opts = Options.new
|
opts = Options.coerce(%w(--with-foo --with-bar --without-baz --without-qux))
|
||||||
opts << Option.new("with-foo") << Option.new("with-bar")
|
|
||||||
opts << Option.new("without-baz") << Option.new("without-qux")
|
|
||||||
@build = BuildOptions.new(args, opts)
|
@build = BuildOptions.new(args, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user