1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

move mongoid and mongo_mapper loading and initialisation into its own file

This commit is contained in:
Thorsten Böttger 2017-02-10 22:28:38 +11:00
parent 57f18bac89
commit 68d945f0fb
6 changed files with 28 additions and 32 deletions

View file

@ -0,0 +1,6 @@
begin
require 'mongo_mapper'
puts "mongo_mapper gem found, running MongoMapper specs \e[32m#{'✔'}\e[0m"
rescue LoadError
puts "mongo_mapper gem not found, not running MongoMapper specs \e[31m#{'✖'}\e[0m"
end

View file

@ -0,0 +1,6 @@
begin
require 'mongoid'
puts "mongoid gem found, running mongoid specs \e[32m#{'✔'}\e[0m"
rescue LoadError
puts "mongoid gem not found, not running mongoid specs \e[31m#{'✖'}\e[0m"
end

View file

@ -1,9 +1,7 @@
describe 'mongo_mapper' do
begin
require 'mongo_mapper'
require 'logger'
require 'spec_helper'
puts "mongo_mapper gem found, running MongoMapper specs \e[32m#{'✔'}\e[0m"
require 'spec_helper'
if defined?(MongoMapper)
describe 'mongo_mapper' do
Dir[File.dirname(__FILE__) + "/../../models/mongo_mapper/*.rb"].sort.each do |f|
require File.expand_path(f)
@ -142,7 +140,5 @@ describe 'mongo_mapper' do
end
end
rescue LoadError
puts "mongo_mapper gem not found, not running MongoMapper specs \e[31m#{'✖'}\e[0m"
end
end

View file

@ -1,9 +1,7 @@
describe 'mongo_mapper' do
begin
require 'mongo_mapper'
require 'logger'
require 'spec_helper'
puts "mongo_mapper gem found, running MongoMapper specs \e[32m#{'✔'}\e[0m"
require 'spec_helper'
if defined?(MongoMapper)
describe 'mongo_mapper' do
Dir[File.dirname(__FILE__) + "/../../models/mongo_mapper/*.rb"].sort.each do |f|
require File.expand_path(f)
@ -89,7 +87,5 @@ describe 'mongo_mapper' do
end
end
rescue LoadError
puts "mongo_mapper gem not found, not running MongoMapper specs \e[31m#{'✖'}\e[0m"
end
end

View file

@ -1,9 +1,7 @@
describe 'mongoid' do
begin
require 'mongoid'
require 'logger'
require 'spec_helper'
puts "mongoid gem found, running mongoid specs \e[32m#{'✔'}\e[0m"
require 'spec_helper'
if defined?(Mongoid::Document)
describe 'mongoid' do
Dir[File.dirname(__FILE__) + "/../../models/mongoid/*.rb"].sort.each do |f|
require File.expand_path(f)
@ -123,7 +121,5 @@ describe 'mongoid' do
end
end
rescue LoadError
puts "mongoid gem not found, not running mongoid specs \e[31m#{'✖'}\e[0m"
end
end

View file

@ -1,9 +1,7 @@
describe 'mongoid' do
begin
require 'mongoid'
require 'logger'
require 'spec_helper'
puts "mongoid gem found, running mongoid specs \e[32m#{'✔'}\e[0m"
require 'spec_helper'
if defined?(Mongoid::Document)
describe 'mongoid' do
Dir[File.dirname(__FILE__) + "/../../models/mongoid/*.rb"].sort.each do |f|
require File.expand_path(f)
@ -86,7 +84,5 @@ describe 'mongoid' do
end
rescue LoadError
puts "mongoid gem not found, not running mongoid specs \e[31m#{'✖'}\e[0m"
end
end