]> git.wincent.com - wikitext.git/commitdiff
spec: prepend to load path to ensure development version gets tested
authorWincent Colaiuta <win@wincent.com>
Sat, 27 Sep 2008 19:35:58 +0000 (21:35 +0200)
committerWincent Colaiuta <win@wincent.com>
Sat, 27 Sep 2008 19:35:58 +0000 (21:35 +0200)
We were appending to the load path so we could conceivably end up with
a previously installed version of the extension getting tested instead
of the just-built version, so prepend instead.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
spec/spec_helper.rb

index 81bc844e3beecd8ac5dd0b675e75f8346a3b5361..9dcc530906cb2ed76be91310ab5730c9e737bcd9 100644 (file)
@@ -44,11 +44,11 @@ end
 
 module Wikitext
   if not const_defined? 'EXTDIR'
-    # append the local "ext" directory to search path if not already present
+    # prepend the local "ext" directory to search path if not already present
     base        = File.join(File.dirname(__FILE__), '..')
     EXTDIR      = Pathname.new(File.join(base, 'ext')).realpath
     normalized  = $:.collect { |path| Pathname.new(path).realpath rescue path }
-    $:.push(EXTDIR) unless normalized.include?(EXTDIR)
+    $:.unshift(EXTDIR) unless normalized.include?(EXTDIR)
   end
 end # module Wikitext