diff options
Diffstat (limited to 'Library/Homebrew/test/test_software_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/test_software_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_software_spec.rb b/Library/Homebrew/test/test_software_spec.rb index d4b271177..e067f2f10 100644 --- a/Library/Homebrew/test/test_software_spec.rb +++ b/Library/Homebrew/test/test_software_spec.rb @@ -72,6 +72,30 @@ class SoftwareSpecTests < Homebrew::TestCase assert_equal "", @spec.options.first.description end + def test_deprecated_option + @spec.deprecated_option('foo' => 'bar') + assert @spec.deprecated_options.any? + assert_equal "foo", @spec.deprecated_options.first.old + assert_equal "bar", @spec.deprecated_options.first.current + end + + def test_deprecated_options + @spec.deprecated_option(['foo1', 'foo2'] => 'bar1', 'foo3' => ['bar2', 'bar3']) + refute_empty @spec.deprecated_options + assert_equal "foo1", @spec.deprecated_options.first.old + assert_equal "bar1", @spec.deprecated_options.first.current + assert_equal "foo2", @spec.deprecated_options[1].old + assert_equal "bar1", @spec.deprecated_options[1].current + assert_equal "foo3", @spec.deprecated_options[2].old + assert_equal "bar2", @spec.deprecated_options[2].current + assert_equal "foo3", @spec.deprecated_options.last.old + assert_equal "bar3", @spec.deprecated_options.last.current + end + + def test_deprecated_option_raises_when_empty + assert_raises(ArgumentError) { @spec.deprecated_option({}) } + end + def test_depends_on @spec.depends_on('foo') assert_equal 'foo', @spec.deps.first.name |
