aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Ross2017-01-05 00:22:56 +0000
committerAlyssa Ross2017-01-05 00:22:56 +0000
commit4c061fc1833521b3e943de2e2d16029966cd7164 (patch)
tree5eb85099debc19202f50494b34e8233677e24a16
parent98dadd907e31bb5f9a16bfb6aa2138b1852c4db5 (diff)
downloadbrew-4c061fc1833521b3e943de2e2d16029966cd7164.tar.bz2
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.
-rw-r--r--Library/Homebrew/dependency.rb2
-rw-r--r--Library/Homebrew/test/dependency_test.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb
index 253ba4bee..4a452440a 100644
--- a/Library/Homebrew/dependency.rb
+++ b/Library/Homebrew/dependency.rb
@@ -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
diff --git a/Library/Homebrew/test/dependency_test.rb b/Library/Homebrew/test/dependency_test.rb
index 65255995e..134e91d13 100644
--- a/Library/Homebrew/test/dependency_test.rb
+++ b/Library/Homebrew/test/dependency_test.rb
@@ -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