From 640ee5b68d1078fc164bd4e10c019f284ad9b760 Mon Sep 17 00:00:00 2001 From: wycats Date: Wed, 17 Mar 2010 00:53:48 -0700 Subject: Fix some more warnings on 1.9 --- .../active_support/core_ext/class/delegating_attributes.rb | 2 ++ activesupport/test/abstract_unit.rb | 11 +++++++++-- activesupport/test/core_ext/string_ext_test.rb | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb index b5785bdcd3..df4954e67a 100644 --- a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +++ b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb @@ -27,7 +27,9 @@ private # inheritance behavior, without having to store the object in an instance # variable and look up the superclass chain manually. def _stash_object_in_method(object, method, instance_reader = true) + singleton_class.send(:remove_possible_method, method) singleton_class.send(:define_method, method) { object } + remove_possible_method(method) define_method(method) { object } if instance_reader end diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb index da338a2a26..67f652325e 100644 --- a/activesupport/test/abstract_unit.rb +++ b/activesupport/test/abstract_unit.rb @@ -1,10 +1,17 @@ -require File.expand_path('../../../load_paths', __FILE__) +begin + old, $VERBOSE = $VERBOSE, nil + require File.expand_path('../../../load_paths', __FILE__) +ensure + $VERBOSE = old +end lib = File.expand_path("#{File.dirname(__FILE__)}/../lib") $:.unshift(lib) unless $:.include?('lib') || $:.include?(lib) require 'test/unit' -require 'mocha' +require 'active_support/core_ext/kernel/reporting' + +silence_warnings { require 'mocha' } ENV['NO_RELOAD'] = '1' require 'active_support' diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index a50e259726..234e41c772 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -285,7 +285,7 @@ class TestGetTextString < Test::Unit::TestCase def test_percent assert_equal("% 1", "%% %d" % {:num => 1.0}) - assert_equal("%{num} %d", "%%{num} %%d" % {:num => 1}) + assert_equal("%{num} %d 1", "%%{num} %%d %d" % {:num => 1}) end def test_sprintf_percent_in_replacement -- cgit v1.2.3