mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fix some more warnings on 1.9
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -285,7 +285,7 @@ class TestGetTextString < Test::Unit::TestCase
|
||||
|
||||
def test_percent
|
||||
assert_equal("% 1", "%% %<num>d" % {:num => 1.0})
|
||||
assert_equal("%{num} %<num>d", "%%{num} %%<num>d" % {:num => 1})
|
||||
assert_equal("%{num} %<num>d 1", "%%{num} %%<num>d %<num>d" % {:num => 1})
|
||||
end
|
||||
|
||||
def test_sprintf_percent_in_replacement
|
||||
|
||||
Reference in New Issue
Block a user