From 98dbfa2865ad270d5fd9821c6518f6f30ce9aec4 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 12 Feb 2008 23:00:40 -0600 Subject: Loading the mocha gem from the puppettest.rb file. --- test/lib/puppettest.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb index 76ae96e02..6c95985bf 100755 --- a/test/lib/puppettest.rb +++ b/test/lib/puppettest.rb @@ -6,7 +6,16 @@ mainlib = File.expand_path(File.join(File.dirname(__FILE__), '../../lib')) $LOAD_PATH.unshift(mainlib) unless $LOAD_PATH.include?(mainlib) require 'puppet' -require 'mocha' + +# include any gems in vendor/gems +Dir["#{mainlib}/../vendor/gems/**"].each do |path| + libpath = File.join(path, "lib") + if File.directory?(libpath) + $LOAD_PATH.unshift(libpath) + else + $LOAD_PATH.unshift(path) + end +end # Only load the test/unit class if we're not in the spec directory. # Else we get the bogus 'no tests, no failures' message. -- cgit