mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
more information on how to run the examples/features alone
This commit is contained in:
parent
971cdc9460
commit
da7b965369
1 changed files with 19 additions and 12 deletions
|
@ -1,16 +1,23 @@
|
|||
require 'rubygems'
|
||||
require 'spec/expectations'
|
||||
|
||||
begin
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{ENV['ORM']}"
|
||||
rescue LoadError
|
||||
raise "I don't have the setup for the '#{ENV['ORM']}' ORM!"
|
||||
orm = ENV['ORM']
|
||||
strategy = ENV['STRATEGY']
|
||||
|
||||
if orm && strategy
|
||||
|
||||
begin
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{orm}"
|
||||
rescue LoadError
|
||||
raise "You don't have the #{orm} ORM installed"
|
||||
end
|
||||
|
||||
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
|
||||
require 'database_cleaner'
|
||||
require 'database_cleaner/cucumber'
|
||||
|
||||
DatabaseCleaner.strategy = strategy.to_sym
|
||||
|
||||
else
|
||||
raise "Run 'ORM=activerecord|datamapper STRATEGY=transaction|truncation cucumber examples/features'"
|
||||
end
|
||||
|
||||
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
|
||||
require 'database_cleaner'
|
||||
require 'database_cleaner/cucumber'
|
||||
|
||||
DatabaseCleaner.strategy = ENV['STRATEGY'].to_sym
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue