[#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
This commit is contained in:
Holger Just 2011-11-26 20:33:46 +01:00
parent 9f4d12ffdf
commit 0b952a1edd
1 changed files with 6 additions and 0 deletions

View File

@ -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