From 0b952a1eddf6fe899bae152265ad9c7db6a2a278 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Sat, 26 Nov 2011 20:33:46 +0100 Subject: [PATCH] [#263] Fix test error on Ruby 1.9 TreeNode#to_s (from the rubytree gem) is broken. It is implicitly called by Shoulda on 1.9 only. As we don't actually need it, we just remove the method. The bug is reported at http://rubyforge.org/tracker/index.php?func=detail&aid=29435&group_id=1215&atid=4793 --- test/functional/auth_sources_controller_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/auth_sources_controller_test.rb b/test/functional/auth_sources_controller_test.rb index e462f669..e79fa933 100644 --- a/test/functional/auth_sources_controller_test.rb +++ b/test/functional/auth_sources_controller_test.rb @@ -14,6 +14,12 @@ require File.expand_path('../../test_helper', __FILE__) +# Remove to_s on the TreeNode. This would cause an error on Ruby 1.9 as the +# method has a bug preventing it to return strings. It is implicitly called by +# shoulda during an inspect on Ruby 1.9 only. The bug is reported at +# http://rubyforge.org/tracker/index.php?func=detail&aid=29435&group_id=1215&atid=4793 +Tree::TreeNode.class_eval {remove_method :to_s} + class AuthSourcesControllerTest < ActionController::TestCase fixtures :all