aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorAdam Vandenberg2010-04-08 14:50:06 -0700
committerAdam Vandenberg2010-04-09 11:21:35 -0700
commitbada8fe2e6edaa36dfbc21cd5160b57a654e9309 (patch)
treebbee226a8cad70968196bb9c7a65b284ec684e1f /Library/Homebrew/test
parent08c981ef8a7b377c5b695a91b20138ff795adf51 (diff)
downloadhomebrew-bada8fe2e6edaa36dfbc21cd5160b57a654e9309.tar.bz2
Support jruby external dependencies.
* Add tests that run only if 'jruby' is installed. * Note that if your formula has :jruby deps, it should likely "depend_on 'jruby'" as well.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_external_deps.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_external_deps.rb b/Library/Homebrew/test/test_external_deps.rb
index 373d334ba..2b96e7678 100644
--- a/Library/Homebrew/test/test_external_deps.rb
+++ b/Library/Homebrew/test/test_external_deps.rb
@@ -27,6 +27,10 @@ class DontActuallyInstall < FormulaInstaller
def rberr dep
"Ruby module install message."
end
+
+ def jrberr dep
+ "JRuby module install message."
+ end
end
@@ -79,6 +83,22 @@ class GoodRubyBall <TestBall
end
end
+class BadJRubyBall <TestBall
+ depends_on "notapackage" => :jruby
+
+ def initialize name=nil
+ super "uses_jruby_ball"
+ end
+end
+
+class GoodJRubyBall <TestBall
+ depends_on "date" => :jruby
+
+ def initialize name=nil
+ super "uses_jruby_ball"
+ end
+end
+
class ExternalDepsTests < Test::Unit::TestCase
def check_deps_fail f
@@ -117,4 +137,13 @@ class ExternalDepsTests < Test::Unit::TestCase
def test_good_ruby_deps
check_deps_pass GoodRubyBall
end
+
+ # Only run these next two tests if jruby is installed.
+ def test_bad_jruby_deps
+ check_deps_fail BadJRubyBall unless `/usr/bin/which jruby`.chomp.empty?
+ end
+
+ def test_good_jruby_deps
+ check_deps_pass GoodJRubyBall unless `/usr/bin/which jruby`.chomp.empty?
+ end
end