diff --git a/examples/features/support/env.rb b/examples/features/support/env.rb index ea9fe57..076fc69 100644 --- a/examples/features/support/env.rb +++ b/examples/features/support/env.rb @@ -5,9 +5,9 @@ orm = ENV['ORM'] strategy = ENV['STRATEGY'] if orm && strategy - + begin - require "#{File.dirname(__FILE__)}/../../lib/#{orm}" + require "#{File.dirname(__FILE__)}/../../lib/#{orm}_models" rescue LoadError raise "You don't have the #{orm} ORM installed" end diff --git a/examples/lib/activerecord.rb b/examples/lib/activerecord_models.rb similarity index 100% rename from examples/lib/activerecord.rb rename to examples/lib/activerecord_models.rb diff --git a/examples/lib/couchpotato.rb b/examples/lib/couchpotato_models.rb similarity index 100% rename from examples/lib/couchpotato.rb rename to examples/lib/couchpotato_models.rb diff --git a/examples/lib/datamapper.rb b/examples/lib/datamapper_models.rb similarity index 100% rename from examples/lib/datamapper.rb rename to examples/lib/datamapper_models.rb diff --git a/examples/lib/mongomapper.rb b/examples/lib/mongomapper_models.rb similarity index 57% rename from examples/lib/mongomapper.rb rename to examples/lib/mongomapper_models.rb index 6d4dfae..84abf6e 100644 --- a/examples/lib/mongomapper.rb +++ b/examples/lib/mongomapper_models.rb @@ -1,4 +1,4 @@ -require 'mongo_mapper' +require 'mongomapper' ::MongoMapper.connection = Mongo::Connection.new('127.0.0.1') ::MongoMapper.database = 'database_cleaner_test' @@ -7,4 +7,11 @@ class Widget include MongoMapper::Document key :id, Integer key :name, String + + class << self + #mongomapper doesn't seem to provide this... + def create!(*args) + new(*args).save! + end + end end