Permalink
Browse files

skip Mongoid specs if not present in the bundle

  • Loading branch information...
1 parent 6fcbe84 commit a777bc82bb756673361a344508c1460bbcef22cb @mislav committed Feb 4, 2013
Showing with 13 additions and 5 deletions.
  1. +13 −5 spec/finders/mongoid_spec.rb
@@ -1,10 +1,18 @@
require 'spec_helper'
-require 'will_paginate/mongoid'
-Mongoid.database = Mongo::Connection.new.db('will_paginate_test')
+begin
+ require 'will_paginate/mongoid'
+rescue LoadError => error
+ warn "Error running Sequel specs: #{error.message}"
+ mongoid_loaded = false
+else
+ Mongoid.database = Mongo::Connection.new.db('will_paginate_test')
-class MongoidModel
- include Mongoid::Document
+ class MongoidModel
+ include Mongoid::Document
+ end
+
+ mongoid_loaded = true
end
describe WillPaginate::Mongoid do
@@ -129,4 +137,4 @@ class MongoidModel
end
end
end
-end
+end if mongoid_loaded

0 comments on commit a777bc8

Please sign in to comment.