提交 32844cbc 编写于 作者: A Aaron Patterson

fixing space errors

上级 c819c131
......@@ -5,11 +5,11 @@ module Deprecation
class DeprecationProxy #:nodoc:
def self.new(*args, &block)
object = args.first
return object unless object
super
end
instance_methods.each { |m| undef_method m unless m =~ /^__|^object_id$/ }
# Don't give a deprecation warning on inspect since test/unit and error
......
......@@ -4,19 +4,19 @@
class ProxyWrappersTest < Test::Unit::TestCase
Waffles = false
NewWaffles = :hamburgers
def test_deprecated_object_proxy_doesnt_wrap_falsy_objects
proxy = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(nil, "message")
assert !proxy
end
def test_deprecated_instance_variable_proxy_doesnt_wrap_falsy_objects
proxy = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(nil, :waffles)
assert !proxy
end
def test_deprecated_constant_proxy_doesnt_wrap_falsy_objects
proxy = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(Waffles, NewWaffles)
assert !proxy
end
end
\ No newline at end of file
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册