2009-03-01 03:45:58 -05:00
|
|
|
require 'rubygems'
|
|
|
|
require 'spec/expectations'
|
|
|
|
|
2009-05-07 11:36:02 -04:00
|
|
|
orm = ENV['ORM']
|
|
|
|
strategy = ENV['STRATEGY']
|
2009-03-01 03:45:58 -05:00
|
|
|
|
2009-05-07 11:36:02 -04:00
|
|
|
if orm && strategy
|
|
|
|
|
|
|
|
begin
|
|
|
|
require "#{File.dirname(__FILE__)}/../../lib/#{orm}"
|
|
|
|
rescue LoadError
|
|
|
|
raise "You don't have the #{orm} ORM installed"
|
|
|
|
end
|
2009-03-01 03:45:58 -05:00
|
|
|
|
2009-05-07 11:36:02 -04:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
|
|
|
|
require 'database_cleaner'
|
|
|
|
require 'database_cleaner/cucumber'
|
2009-03-01 03:45:58 -05:00
|
|
|
|
2009-05-07 11:36:02 -04:00
|
|
|
DatabaseCleaner.strategy = strategy.to_sym
|
|
|
|
|
|
|
|
else
|
2010-02-03 20:17:37 -05:00
|
|
|
raise "Run 'ORM=activerecord|datamapper|mongomapper|couchpotato STRATEGY=transaction|truncation cucumber examples/features'"
|
2009-05-07 11:36:02 -04:00
|
|
|
end
|