buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject External extensions use of buildr test infrastructure
Date Sun, 28 Mar 2010 21:52:16 GMT

I am currently playing with a few different buildr extensions and I
desire to make use of the test infrastructure part of buildr proper.
What is the typical approach to doing this sort of thing? Currently I
have gone with adding something like the following into my spec_helper
/ test_helper

# TODO: If we are installed as a gem we should just add dependency on
buildr gem and find dir based on that
DEFAULT_BUILDR_DIR=File.expand_path(File.dirname(__FILE__) + '/../../buildr')

unless File.exist?("#{BUILDR_DIR}/buildr.gemspec")
  raise "Unable to find buildr.gemspec in #{BUILDR_DIR ==
DEFAULT_BUILDR_DIR ? 'guessed' : 'specified'} $BUILD_DIR

require 'rubygems'

# For testing we use the gem requirements specified on the buildr.gemspec
    dependencies.each { |dep| gem, dep.requirement.to_s }

Then depending on what types of tests I am running adding something
like the following a bit later.

require "#{BUILDR_DIR}/spec/spec_helpers.rb"

You can see an example in

My main goal is to be able to test the plugin against trunk buildr and
against the last release. Down the track I will also want it to work
if/when the extension is released as a gem.

So has anyone got a recommend approach to do this sort of thing? Is
what I am doing the right way of doing things or am I going to run
into issues?


Peter Donald

View raw message