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
commitcfc8fca74d642d5b09d8b45a802f3114948ed32f (patch)
treef19d2dab14b5f8ad967d1970fa255e719cc4f58c /Library/Homebrew/test
parent72ef9f4aaa8c86aa422cb735eeba7f809e53a84c (diff)
downloadbrew-cfc8fca74d642d5b09d8b45a802f3114948ed32f.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