From ecaf1592a095611f6f05e307454df82d4442eef2 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 12 Aug 2014 20:09:35 -0500 Subject: [PATCH] Always pass an Options instance to the BuildOptions constructor --- Library/Homebrew/build_options.rb | 2 +- Library/Homebrew/software_spec.rb | 2 +- Library/Homebrew/test/test_build_options.rb | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index f3c7e856e3..19169af3d3 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -4,7 +4,7 @@ class BuildOptions attr_accessor :universal def initialize(args, options) - @args = Options.coerce(args) + @args = args @options = options end diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index c595a45962..e88975a733 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -34,7 +34,7 @@ class SoftwareSpec @bottle_specification = BottleSpecification.new @patches = [] @options = Options.new - @build = BuildOptions.new(ARGV.options_only, options) + @build = BuildOptions.new(Options.coerce(ARGV.options_only), options) end def owner= owner diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/test_build_options.rb index e3ed44f9da..4ee12974bf 100644 --- a/Library/Homebrew/test/test_build_options.rb +++ b/Library/Homebrew/test/test_build_options.rb @@ -3,10 +3,8 @@ require 'build_options' class BuildOptionsTests < Homebrew::TestCase def setup - args = %w{--with-foo --with-bar --without-qux} - opts = Options.new - opts << Option.new("with-foo") << Option.new("with-bar") - opts << Option.new("without-baz") << Option.new("without-qux") + args = Options.coerce(%w(--with-foo --with-bar --without-qux)) + opts = Options.coerce(%w(--with-foo --with-bar --without-baz --without-qux)) @build = BuildOptions.new(args, opts) end