@@ -42,7 +42,7 @@ def setup
42
42
test "assert_deprecated is deprecated without a deprecator" do
43
43
assert_deprecated ( ActiveSupport . deprecator ) do
44
44
assert_deprecated do
45
- ActiveSupport ::Deprecation . instance . warn
45
+ ActiveSupport ::Deprecation . _instance . warn
46
46
end
47
47
end
48
48
end
@@ -114,7 +114,7 @@ def setup
114
114
klass . deprecate :zero
115
115
end
116
116
assert_match "Module.deprecate without a deprecator is deprecated" , deprecations . sole
117
- assert_deprecated ( /zero is deprecated/ , ActiveSupport ::Deprecation . instance ) do
117
+ assert_deprecated ( /zero is deprecated/ , ActiveSupport ::Deprecation . _instance ) do
118
118
klass . new . zero
119
119
end
120
120
end
@@ -761,7 +761,7 @@ def method
761
761
762
762
test "warn delegator is deprecated" do
763
763
assert_deprecated ( "use your own Deprecation object instead" , ActiveSupport . deprecator ) do
764
- assert_deprecated ( ActiveSupport ::Deprecation . instance ) do
764
+ assert_deprecated ( ActiveSupport ::Deprecation . _instance ) do
765
765
ActiveSupport ::Deprecation . warn
766
766
end
767
767
end
@@ -798,15 +798,15 @@ def method
798
798
end
799
799
800
800
test "behavior delegators are deprecated" do
801
- old_behavior = ActiveSupport ::Deprecation . instance . behavior
801
+ old_behavior = ActiveSupport ::Deprecation . _instance . behavior
802
802
assert_deprecated ( "use Rails.application.deprecators[framework].behavior" , ActiveSupport . deprecator ) do
803
803
ActiveSupport ::Deprecation . behavior
804
804
end
805
805
assert_deprecated ( "use Rails.application.deprecators.behavior= instead" , ActiveSupport . deprecator ) do
806
806
ActiveSupport ::Deprecation . behavior = -> ( *) { }
807
807
end
808
808
ensure
809
- ActiveSupport ::Deprecation . instance . behavior = old_behavior
809
+ ActiveSupport ::Deprecation . _instance . behavior = old_behavior
810
810
end
811
811
812
812
test "behavior= delegator is deprecated and delegates to the application's deprecators when available" do
@@ -821,15 +821,15 @@ def method
821
821
end
822
822
823
823
test "disallowed_behavior delegators are deprecated" do
824
- old_behavior = ActiveSupport ::Deprecation . instance . disallowed_behavior
824
+ old_behavior = ActiveSupport ::Deprecation . _instance . disallowed_behavior
825
825
assert_deprecated ( "use Rails.application.deprecators[framework].disallowed_behavior" , ActiveSupport . deprecator ) do
826
826
ActiveSupport ::Deprecation . disallowed_behavior
827
827
end
828
828
assert_deprecated ( "use Rails.application.deprecators.disallowed_behavior= instead" , ActiveSupport . deprecator ) do
829
829
ActiveSupport ::Deprecation . disallowed_behavior = -> ( *) { }
830
830
end
831
831
ensure
832
- ActiveSupport ::Deprecation . instance . disallowed_behavior = old_behavior
832
+ ActiveSupport ::Deprecation . _instance . disallowed_behavior = old_behavior
833
833
end
834
834
835
835
test "disallowed_behavior= delegators is deprecated and delegates to the application's deprecators when available" do
@@ -845,15 +845,15 @@ def method
845
845
end
846
846
847
847
test "debug delegators are deprecated" do
848
- old_debug = ActiveSupport ::Deprecation . instance . debug
848
+ old_debug = ActiveSupport ::Deprecation . _instance . debug
849
849
assert_deprecated ( "use Rails.application.deprecators[framework].debug" , ActiveSupport . deprecator ) do
850
850
ActiveSupport ::Deprecation . debug
851
851
end
852
852
assert_deprecated ( "use Rails.application.deprecators.debug= instead" , ActiveSupport . deprecator ) do
853
853
ActiveSupport ::Deprecation . debug = true
854
854
end
855
855
ensure
856
- ActiveSupport ::Deprecation . instance . debug = old_debug
856
+ ActiveSupport ::Deprecation . _instance . debug = old_debug
857
857
end
858
858
859
859
test "debug= delegator is deprecated and delegates to the application's deprecators when available" do
@@ -866,15 +866,15 @@ def method
866
866
end
867
867
868
868
test "silenced delegators are deprecated" do
869
- old_silenced = ActiveSupport ::Deprecation . instance . silenced
869
+ old_silenced = ActiveSupport ::Deprecation . _instance . silenced
870
870
assert_deprecated ( "use Rails.application.deprecators[framework].silenced" , ActiveSupport . deprecator ) do
871
871
ActiveSupport ::Deprecation . silenced
872
872
end
873
873
assert_deprecated ( "use Rails.application.deprecators.silenced= instead" , ActiveSupport . deprecator ) do
874
874
ActiveSupport ::Deprecation . silenced = true
875
875
end
876
876
ensure
877
- ActiveSupport ::Deprecation . instance . silenced = old_silenced
877
+ ActiveSupport ::Deprecation . _instance . silenced = old_silenced
878
878
end
879
879
880
880
test "silenced= delegator is deprecated and delegates to the application's deprecators when available" do
@@ -887,15 +887,15 @@ def method
887
887
end
888
888
889
889
test "disallowed_warnings delegators are deprecated" do
890
- old_disallowed_warnings = ActiveSupport ::Deprecation . instance . disallowed_warnings
890
+ old_disallowed_warnings = ActiveSupport ::Deprecation . _instance . disallowed_warnings
891
891
assert_deprecated ( "use Rails.application.deprecators[framework].disallowed_warnings" , ActiveSupport . deprecator ) do
892
892
ActiveSupport ::Deprecation . disallowed_warnings
893
893
end
894
894
assert_deprecated ( "use Rails.application.deprecators.disallowed_warnings= instead" , ActiveSupport . deprecator ) do
895
895
ActiveSupport ::Deprecation . disallowed_warnings = :all
896
896
end
897
897
ensure
898
- ActiveSupport ::Deprecation . instance . disallowed_warnings = old_disallowed_warnings
898
+ ActiveSupport ::Deprecation . _instance . disallowed_warnings = old_disallowed_warnings
899
899
end
900
900
901
901
test "disallowed_warnings= delegator is deprecated and delegates to the application's deprecators when available" do
@@ -908,27 +908,27 @@ def method
908
908
end
909
909
910
910
test "gem_name delegators are deprecated" do
911
- old_gem_name = ActiveSupport ::Deprecation . instance . gem_name
911
+ old_gem_name = ActiveSupport ::Deprecation . _instance . gem_name
912
912
assert_deprecated ( "use your own Deprecation object instead" , ActiveSupport . deprecator ) do
913
913
ActiveSupport ::Deprecation . gem_name
914
914
end
915
915
assert_deprecated ( "use your own Deprecation object instead" , ActiveSupport . deprecator ) do
916
916
ActiveSupport ::Deprecation . gem_name = "MyGem"
917
917
end
918
918
ensure
919
- ActiveSupport ::Deprecation . instance . gem_name = old_gem_name
919
+ ActiveSupport ::Deprecation . _instance . gem_name = old_gem_name
920
920
end
921
921
922
922
test "deprecation_horizon delegators are deprecated" do
923
- old_deprecation_horizon = ActiveSupport ::Deprecation . instance . deprecation_horizon
923
+ old_deprecation_horizon = ActiveSupport ::Deprecation . _instance . deprecation_horizon
924
924
assert_deprecated ( "use your own Deprecation object instead" , ActiveSupport . deprecator ) do
925
925
ActiveSupport ::Deprecation . deprecation_horizon
926
926
end
927
927
assert_deprecated ( "use your own Deprecation object instead" , ActiveSupport . deprecator ) do
928
928
ActiveSupport ::Deprecation . deprecation_horizon = "2.0"
929
929
end
930
930
ensure
931
- ActiveSupport ::Deprecation . instance . deprecation_horizon = old_deprecation_horizon
931
+ ActiveSupport ::Deprecation . _instance . deprecation_horizon = old_deprecation_horizon
932
932
end
933
933
934
934
test "warn deprecation skips the internal caller locations" do
0 commit comments