rails/activesupport/test/proxy_object_test.rb
Earlopain ea7d3c5165
Deprecate ActiveSupport::ProxyObject
A historic leftover from when Ruby didn't have `BasicObject`
2024-04-22 18:51:38 +02:00

17 lines
394 B
Ruby

# frozen_string_literal: true
require_relative "abstract_unit"
class ProxyObjectTest < ActiveSupport::TestCase
def test_accessing_proxy_object_is_deprecated
proxy = assert_deprecated(ActiveSupport.deprecator) do
Class.new(ActiveSupport::ProxyObject) do
def some_method
"foo"
end
end
end
assert_equal("foo", proxy.new.some_method)
end
end