diff options
| author | Jack Nagel | 2014-07-31 19:37:39 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-31 19:37:39 -0500 |
| commit | abdff27cd7052619a029845b29cb3fd5054c9285 (patch) | |
| tree | e9c946bfa20b748c7ecaaec80e1f37255952f628 /Library/Homebrew/test | |
| parent | fad2e26395f09d78e51a9da5965e28d72b3c9cc2 (diff) | |
| download | brew-abdff27cd7052619a029845b29cb3fd5054c9285.tar.bz2 | |
Make options available on the spec objects
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_build_options.rb | 15 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_software_spec.rb | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/test_build_options.rb index 95388a0ea..b73108bff 100644 --- a/Library/Homebrew/test/test_build_options.rb +++ b/Library/Homebrew/test/test_build_options.rb @@ -4,11 +4,10 @@ require 'build_options' class BuildOptionsTests < Homebrew::TestCase def setup args = %w{--with-foo --with-bar --without-qux} - @build = BuildOptions.new(args) - @build.add("with-foo") - @build.add("with-bar") - @build.add("without-baz") - @build.add("without-qux") + opts = Options.new + opts << Option.new("with-foo") << Option.new("with-bar") + opts << Option.new("without-baz") << Option.new("without-qux") + @build = BuildOptions.new(args, opts) end def test_as_flags @@ -44,13 +43,13 @@ class BuildOptionsTests < Homebrew::TestCase end def test_copies_do_not_share_underlying_options - orig = BuildOptions.new [] + orig = BuildOptions.new [], Options.new copy = orig.dup - refute_same orig.args, copy.args + refute_same orig.options, copy.options end def test_copies_do_not_share_underlying_args - orig = BuildOptions.new [] + orig = BuildOptions.new [], Options.new copy = orig.dup refute_same orig.args, copy.args end diff --git a/Library/Homebrew/test/test_software_spec.rb b/Library/Homebrew/test/test_software_spec.rb index 313a502e0..02f586569 100644 --- a/Library/Homebrew/test/test_software_spec.rb +++ b/Library/Homebrew/test/test_software_spec.rb @@ -75,7 +75,7 @@ class SoftwareSpecTests < Homebrew::TestCase def test_explicit_options_override_default_dep_option_description @spec.option('with-foo', 'blah') @spec.depends_on('foo' => :optional) - assert_equal 'blah', @spec.build.first.description + assert_equal "blah", @spec.options.first.description end def test_patch |
