dependency: TapDependency#tap returns a Tap
Previously, this returned a String, but a Tap instance seems much more sensible. I couldn't find anywhere this method was actually used, so the change shouldn't break anything.
This commit is contained in:
parent
98dadd907e
commit
4c061fc183
@ -175,7 +175,7 @@ class TapDependency < Dependency
|
||||
attr_reader :tap
|
||||
|
||||
def initialize(name, tags = [], env_proc = DEFAULT_ENV_PROC, option_names = [name.split("/").last])
|
||||
@tap = name.rpartition("/").first
|
||||
@tap = Tap.fetch(name.rpartition("/").first)
|
||||
super(name, tags, env_proc, option_names)
|
||||
end
|
||||
|
||||
|
||||
@ -118,6 +118,11 @@ class DependencyTests < Homebrew::TestCase
|
||||
end
|
||||
|
||||
class TapDependencyTests < Homebrew::TestCase
|
||||
def test_tap
|
||||
dep = TapDependency.new("foo/bar/dog")
|
||||
assert_equal Tap.new("foo", "bar"), dep.tap
|
||||
end
|
||||
|
||||
def test_option_names
|
||||
dep = TapDependency.new("foo/bar/dog")
|
||||
assert_equal %w[dog], dep.option_names
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user