changes to allow multiple orm features to run, pass for me, whoop whoop

This commit is contained in:
Jon Rowe 2010-05-16 22:26:56 +01:00
parent 7bf3249105
commit 1f430a0ca3
2 changed files with 27 additions and 3 deletions

View File

@ -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

View File

@ -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'