aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2013-01-23 00:26:30 -0600
committerJack Nagel2013-01-26 12:14:51 -0600
commit7e8d3357896b893a6a7fa84c5bf7bfc146902ca6 (patch)
tree3914030c7042c67484a0a6642a67564a24a6d332 /Library/Homebrew
parent97310a0fed2a7d6c6c3518b36045d68167fd2918 (diff)
downloadhomebrew-7e8d3357896b893a6a7fa84c5bf7bfc146902ca6.tar.bz2
Fix Dependencies -> Array conversion
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/dependencies.rb3
-rw-r--r--Library/Homebrew/test/test_dependencies.rb10
2 files changed, 11 insertions, 2 deletions
diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb
index c9ec0af94..1140c3eeb 100644
--- a/Library/Homebrew/dependencies.rb
+++ b/Library/Homebrew/dependencies.rb
@@ -119,9 +119,10 @@ class Dependencies
@deps * arg
end
- def to_ary
+ def to_a
@deps
end
+ alias_method :to_ary, :to_a
end
module Dependable
diff --git a/Library/Homebrew/test/test_dependencies.rb b/Library/Homebrew/test/test_dependencies.rb
index acf613b3d..973041e01 100644
--- a/Library/Homebrew/test/test_dependencies.rb
+++ b/Library/Homebrew/test/test_dependencies.rb
@@ -33,7 +33,15 @@ class DependenciesTests < Test::Unit::TestCase
assert_equal %q{foo, bar}, @deps*', '
end
+ def test_to_a
+ dep = Dependency.new("foo")
+ @deps << dep
+ assert_equal [dep], @deps.to_a
+ end
+
def test_to_ary
- assert_instance_of Array, @deps.to_ary
+ dep = Dependency.new("foo")
+ @deps << dep
+ assert_equal [dep], @deps.to_ary
end
end