aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/deprecation_test.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2017-01-20 15:02:34 -0800
committerJeremy Daer <jeremydaer@gmail.com>2017-01-25 01:41:27 -0700
commit7da8d76206271bdf200ea201f7e5a49afb9bc9e7 (patch)
treebb8763b3790f6d841327e4435d5b3a6e4e296be0 /activesupport/test/deprecation_test.rb
parent72a869e626e2772733946483e21d65247864d856 (diff)
downloadrails-7da8d76206271bdf200ea201f7e5a49afb9bc9e7.tar.gz
rails-7da8d76206271bdf200ea201f7e5a49afb9bc9e7.tar.bz2
rails-7da8d76206271bdf200ea201f7e5a49afb9bc9e7.zip
Change ActionView ERB Handler from Erubis to Erubi
Erubi offers the following advantages for Rails: * Works with ruby's --enable-frozen-string-literal option * Has 88% smaller memory footprint * Does no freedom patching (Erubis adds a method to Kernel) * Has simpler internals (1 file, <150 lines of code) * Has an open development model (Erubis doesn't have a public source control repository or bug tracker) * Is not dead (Erubis hasn't been updated since 2011) Erubi is a simplified fork of Erubis that contains just the parts that are generally needed (which includes the parts that Rails uses). The only intentional difference in behavior is that it does not include support for <%=== tags for debug output. That could be added to the ActionView ERB handler if it is desired. The Erubis template handler remains in a deprecated state so that code that accesses it directly does not break. It can be removed after Rails 5.1.
Diffstat (limited to 'activesupport/test/deprecation_test.rb')
-rw-r--r--activesupport/test/deprecation_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index 5be93f3a1a..5f72fbf662 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -285,6 +285,16 @@ class DeprecationTest < ActiveSupport::TestCase
end
end
+ def test_deprecated_constant_with_custom_message
+ deprecator = deprecator_with_messages
+
+ klass = Class.new
+ klass.const_set(:OLD, ActiveSupport::Deprecation::DeprecatedConstantProxy.new("klass::OLD", "Object", deprecator, message: "foo"))
+
+ klass::OLD.to_s
+ assert_match "foo", deprecator.messages.last
+ end
+
def test_deprecated_instance_variable_with_instance_deprecator
deprecator = deprecator_with_messages