Index: ruby-saml/test/test_helper.rb
===================================================================
--- ruby-saml.orig/test/test_helper.rb
+++ ruby-saml/test/test_helper.rb
@@ -1,5 +1,7 @@
 #require 'simplecov'
 
+require 'pathname'
+
 #SimpleCov.start do
 #  add_filter "test/"
 #  add_filter "vendor/"
@@ -239,8 +241,9 @@ class Minitest::Test
     zstream.close
     inflated
   end
-
-  SCHEMA_DIR = File.expand_path(File.join(__FILE__, '../../lib/schemas'))
+  RELATIVE_SCHEMA_DIR = File.expand_path(File.join(__FILE__, '../../lib/schemas'))
+  SYSTEM_SCHEMA_DIR = File.expand_path(File.join(File.dirname(`gem which ruby-saml`),'schemas'))
+  SCHEMA_DIR = Pathname.new(RELATIVE_SCHEMA_DIR).directory? ? RELATIVE_SCHEMA_DIR : SYSTEM_SCHEMA_DIR
 
   #
   # validate an xml document against the given schema
