From f5cbf2759fdd5909ec6f126f96be713a17c676e6 Mon Sep 17 00:00:00 2001
From: Ben Woosley <ben.woosley@gmail.com>
Date: Mon, 9 Apr 2012 14:26:47 -0700
Subject: [PATCH] Rework the mongoid_test_helper such that we don't blow up for
 lack of Geocoder::Model::Mongoid

---
 test/mongoid_test.rb        | 9 ---------
 test/mongoid_test_helper.rb | 3 +++
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/test/mongoid_test.rb b/test/mongoid_test.rb
index 67e8c501..2703f4f9 100644
--- a/test/mongoid_test.rb
+++ b/test/mongoid_test.rb
@@ -1,12 +1,7 @@
 # encoding: utf-8
-require 'test_helper'
-
-begin
-require 'mongoid'
 require 'mongoid_test_helper'
 
 class MongoidTest < Test::Unit::TestCase
-
   def test_geocoded_check
     p = Place.new(*venue_params(:msg))
     p.location = [40.750354, -73.993371]
@@ -25,7 +20,3 @@ class MongoidTest < Test::Unit::TestCase
     assert_equal p.selector[:location]['$nearSphere'], location.reverse
   end
 end
-
-rescue LoadError
-  warn 'Mongoid not installed, not tested.'
-end
diff --git a/test/mongoid_test_helper.rb b/test/mongoid_test_helper.rb
index 69eb2fd0..68c2af82 100644
--- a/test/mongoid_test_helper.rb
+++ b/test/mongoid_test_helper.rb
@@ -1,5 +1,8 @@
 require 'rubygems'
 require 'test/unit'
+require 'test_helper'
+require 'mongoid'
+require 'geocoder/models/mongoid'
 
 $LOAD_PATH.unshift(File.dirname(__FILE__))
 $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-- 
GitLab