Skip to content
Snippets Groups Projects
Commit da0a6535 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

Add DeprecatedOption class.

Used to capture options that are being renamed.
parent b91b23f8
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,23 @@ class Option
end
end
class DeprecatedOption
attr_reader :old, :current
def initialize(old, current)
@old = old
@current = current
end
def old_flag
"--#{old}"
end
def current_flag
"--#{current}"
end
end
class Options
include Enumerable
......
......@@ -25,6 +25,20 @@ class OptionTests < Homebrew::TestCase
end
end
class DeprecatedOptionTests < Homebrew::TestCase
def setup
@deprecated_option = DeprecatedOption.new("foo", "bar")
end
def test_old
assert_equal "foo", @deprecated_option.old
end
def test_current
assert_equal "bar", @deprecated_option.current
end
end
class OptionsTests < Homebrew::TestCase
def setup
@options = Options.new
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment