You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by vb...@apache.org on 2008/10/21 20:10:52 UTC
svn commit: r706703 - /incubator/buildr/trunk/spec/spec_helpers.rb
Author: vborja
Date: Tue Oct 21 11:10:52 2008
New Revision: 706703
URL: http://svn.apache.org/viewvc?rev=706703&view=rev
Log:
use buildr.gemspec requirements when running specs, so that examples run with the correct versions for each dep.
Modified:
incubator/buildr/trunk/spec/spec_helpers.rb
Modified: incubator/buildr/trunk/spec/spec_helpers.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/spec_helpers.rb?rev=706703&r1=706702&r2=706703&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/spec_helpers.rb (original)
+++ incubator/buildr/trunk/spec/spec_helpers.rb Tue Oct 21 11:10:52 2008
@@ -19,10 +19,16 @@
unless defined?(SpecHelpers)
require 'rubygems'
+
+ # For testing we use the gem requirements specified on the buildr.gemspec
+ spec = Gem::Specification.load(File.expand_path('../buildr.gemspec', File.dirname(__FILE__)))
+ spec.dependencies.each { |dep| gem dep.name, dep.version_requirements.to_s }
+
# Make sure to load from these paths first, we don't want to load any
# code from Gem library.
$LOAD_PATH.unshift File.expand_path('../lib', File.dirname(__FILE__)),
File.expand_path('../addon', File.dirname(__FILE__))
+
# Buildr uses autoload extensively, but autoload when running specs creates
# a problem -- we sandbox $LOADED_FEATURES, so we endup autoloading the same
# module twice. This turns autoload into a require, which is not the right