mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
changes to allow multiple orm features to run, pass for me, whoop whoop
This commit is contained in:
parent
7bf3249105
commit
1f430a0ca3
2 changed files with 27 additions and 3 deletions
|
@ -0,0 +1,15 @@
|
|||
When /^I create a widget in one orm$/ do
|
||||
Widget.create!
|
||||
end
|
||||
|
||||
When /^I create a widget in another orm$/ do
|
||||
AnotherWidget.create!
|
||||
end
|
||||
|
||||
Then /^I should see ([\d]+) widget in one orm $/ do |widget_count|
|
||||
Widget.count.should == widget_count
|
||||
end
|
||||
|
||||
Then /^I should see ([\d]+) widget in another orm$/ do |widget_count|
|
||||
AnotherWidget.count.should == widget_count
|
||||
end
|
|
@ -3,16 +3,25 @@ Bundler.setup
|
|||
require 'spec/expectations'
|
||||
require 'ruby-debug'
|
||||
|
||||
orm = ENV['ORM']
|
||||
strategy = ENV['STRATEGY']
|
||||
orm = ENV['ORM']
|
||||
another_orm = ENV['ANOTHER_ORM']
|
||||
strategy = ENV['STRATEGY']
|
||||
|
||||
if orm && strategy
|
||||
|
||||
begin
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{orm}_models"
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{orm}_models"
|
||||
rescue LoadError => e
|
||||
raise "You don't have the #{orm} ORM installed"
|
||||
end
|
||||
|
||||
if another_orm
|
||||
begin
|
||||
require "#{File.dirname(__FILE__)}/../../lib/#{another_orm}_models"
|
||||
rescue LoadError => e
|
||||
raise "You don't have the #{another_orm} ORM installed"
|
||||
end
|
||||
end
|
||||
|
||||
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
|
||||
require 'database_cleaner'
|
||||
|
|
Loading…
Reference in a new issue