From cfc8fca74d642d5b09d8b45a802f3114948ed32f Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Thu, 8 Apr 2010 14:50:06 -0700 Subject: 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. --- Library/Homebrew/test/test_external_deps.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'Library/Homebrew/test') 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 :jruby + + def initialize name=nil + super "uses_jruby_ball" + end +end + +class GoodJRubyBall :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 -- cgit v1.2.3