blob: de352e3976e37e07859b0ae177ec58ee0cdbea8c [file] [log] [blame]
$LOAD_PATH.unshift '/srv/whimsy/lib'
require 'whimsy/asf'
# Override with test data if there is no checkout available (allows local use)
if ENV['RAKE_TEST'] == 'TRUE' or not (ASF::SVN.find('apmail_bin') and ASF::SVN.find('board'))
TEST_DATA = true # Test data is smaller so some tests need adjusting
puts "Overriding data directories"
ASF::SVN['apmail_bin'] = File.expand_path('../test/svn/apmail_bin', __dir__)
ASF::SVN['board'] = File.expand_path('../test/svn/board', __dir__)
ASF::SVN['templates'] = File.expand_path('../test/svn/templates', __dir__)
ASF::Config[:subscriptions] = File.expand_path('../test/subscriptions', __dir__)
else
TEST_DATA = false
end
def set_root
ASF::Config.setroot File.expand_path("../test", __dir__)
end
def set_svn(name)
ASF::SVN[name] = File.expand_path("../test/svn/#{name}", __dir__)
end
if TEST_DATA
puts "TEST_DATA=#{TEST_DATA}"
else
puts "TEST_DATA=#{TEST_DATA} (set RAKE_TEST=TRUE to override)"
end
unless defined?(SPEC_ROOT)
SPEC_ROOT = File.join(File.dirname(__FILE__))
end
def fixture_path(*path)
File.join SPEC_ROOT, 'fixtures', path
end