]> git.cworth.org Git - notmuch/blobdiff - test/T395-ruby.sh
test: support testing notmuch as installed
[notmuch] / test / T395-ruby.sh
index c066c84268f3bc07be067f498c0f55949db7b640..d0c6bb17bdda217e1e4aff594f77592fa04636d8 100755 (executable)
@@ -2,7 +2,7 @@
 test_description="ruby bindings"
 . $(dirname "$0")/test-lib.sh || exit 1
 
-if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
+if [ -z "${NOTMUCH_TEST_INSTALLED-}" -a "${NOTMUCH_HAVE_RUBY_DEV-0}" = "0" ]; then
     test_subtest_missing_external_prereq_["ruby development files"]=t
 fi
 
@@ -15,7 +15,11 @@ test_ruby() {
        db = Notmuch::Database.new()
        EOF
        cat
-    ) | $NOTMUCH_RUBY -I "$NOTMUCH_BUILDDIR/bindings/ruby"> OUTPUT
+    ) | if [ -n "${NOTMUCH_TEST_INSTALLED-}" ]; then
+       ruby
+    else
+       $NOTMUCH_RUBY -I "$NOTMUCH_BUILDDIR/bindings/ruby"
+    fi> OUTPUT
     test_expect_equal_file EXPECTED OUTPUT
 }