aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2014-08-12 23:55:28 -0500
committerJack Nagel2014-08-12 23:55:28 -0500
commit8d2ef974a3a87bf4207f71ccb8a7b4776e16a016 (patch)
treef25128e58aab34cb381d7573a93cbeba78d017f2 /Library/Homebrew/test
parentcee42c339e7632eab15111e2c4e6c121ace6f9e2 (diff)
downloadhomebrew-8d2ef974a3a87bf4207f71ccb8a7b4776e16a016.tar.bz2
Replace Options.coerce with an alternate constructor
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_build_options.rb4
-rw-r--r--Library/Homebrew/test/test_options.rb12
2 files changed, 6 insertions, 10 deletions
diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/test_build_options.rb
index a0c52da81..7d2c952d9 100644
--- a/Library/Homebrew/test/test_build_options.rb
+++ b/Library/Homebrew/test/test_build_options.rb
@@ -4,8 +4,8 @@ require "options"
class BuildOptionsTests < Homebrew::TestCase
def setup
- args = Options.coerce(%w(--with-foo --with-bar --without-qux))
- opts = Options.coerce(%w(--with-foo --with-bar --without-baz --without-qux))
+ args = Options.create(%w(--with-foo --with-bar --without-qux))
+ opts = Options.create(%w(--with-foo --with-bar --without-baz --without-qux))
@build = BuildOptions.new(args, opts)
end
diff --git a/Library/Homebrew/test/test_options.rb b/Library/Homebrew/test/test_options.rb
index 250360a30..264ef772a 100644
--- a/Library/Homebrew/test/test_options.rb
+++ b/Library/Homebrew/test/test_options.rb
@@ -132,22 +132,18 @@ class OptionsTests < Homebrew::TestCase
assert_equal [foo, bar, baz].sort, (@options | options).to_a.sort
end
- def test_coerce_with_array
+ def test_create_with_array
array = %w{--foo --bar}
option1 = Option.new("foo")
option2 = Option.new("bar")
- assert_equal [option1, option2].sort, Options.coerce(array).to_a.sort
+ assert_equal [option1, option2].sort, Options.create(array).to_a.sort
end
- def test_coerce_raises_for_inappropriate_types
- assert_raises(TypeError) { Options.coerce(1) }
- end
-
- def test_coerce_splits_multiple_switches_with_single_dash
+ def test_create_splits_multiple_switches_with_single_dash
array = %w{-vd}
verbose = Option.new("-v")
debug = Option.new("-d")
- assert_equal [verbose, debug].sort, Options.coerce(array).to_a.sort
+ assert_equal [verbose, debug].sort, Options.create(array).to_a.sort
end
def test_copies_do_not_share_underlying_collection