Skip to content

Commit

Permalink
skip Mongoid specs if not present in the bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Feb 6, 2013
1 parent 6fcbe84 commit a777bc8
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions 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
Expand Down Expand Up @@ -129,4 +137,4 @@ class MongoidModel
end
end
end
end
end if mongoid_loaded

0 comments on commit a777bc8

Please sign in to comment.