Skip to content
Browse files

Update patch to remove logging and add in test.

  • Loading branch information...
1 parent 72e7efa commit 239029e74afed4870a13f3666a25a3bfe4442a96 @kookster kookster committed Dec 23, 2011
Showing with 12 additions and 2 deletions.
  1. +1 −2 lib/texticle.rb
  2. +11 −0 spec/texticle_spec.rb
View
3 lib/texticle.rb
@@ -52,8 +52,7 @@ def method_missing(method, *search_terms)
def respond_to?(method, include_private = false)
return super if self == ActiveRecord::Base
Helper.dynamic_search_method?(method, self.columns) or super
- rescue StandardError=>err
- logger.info("Texticle::respond_to? error:#{err.class.name}: #{err.message}")
+ rescue StandardError
super
end
View
11 spec/texticle_spec.rb
@@ -69,6 +69,17 @@ class TexticleTest < Test::Unit::TestCase
teardown do
Game.delete_all
end
+
+ should "not break respond_to? when connection is unavailable" do
+ class GameFail < Game
+ end
+
+ GameFail.establish_connection({:adapter => :postgresql, :database =>'unavailable', :username=>'bad', :pool=>5, :timeout=>5000}) rescue nil
+ assert_nothing_raised do
+ GameFail.respond_to?(:search)
+ end
+
+ end
should "define a #search method" do
assert Game.respond_to?(:search)

0 comments on commit 239029e

Please sign in to comment.
Something went wrong with that request. Please try again.