mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-23 06:16:44 +00:00
don't run mongoid spec if not loaded
This commit is contained in:
parent
2756d21abd
commit
99704211a1
@ -1,8 +1,10 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
|
# Try loading mongoid and connecting. Otherwise, abort and skip spec.
|
||||||
|
begin
|
||||||
|
|
||||||
require 'mongoid'
|
require 'mongoid'
|
||||||
require 'validates_timeliness/orm/mongoid'
|
require 'validates_timeliness/orm/mongoid'
|
||||||
|
|
||||||
Mongoid.configure do |config|
|
Mongoid.configure do |config|
|
||||||
name = "validates_timeliness_test"
|
name = "validates_timeliness_test"
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
@ -87,3 +89,9 @@ describe ValidatesTimeliness, 'Mongoid' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
rescue LoadError
|
||||||
|
puts "Mongoid specs skipped. Mongoid not installed"
|
||||||
|
rescue StandardError
|
||||||
|
puts "Mongoid specs skipped. MongoDB connection failed."
|
||||||
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user