From dcb13470991539ab581e02670738900c39976ff4 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Mon, 25 Feb 2019 14:43:30 -0800 Subject: Improve Template#inspect output (#35407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Don't call inspect from identifier_method_name * Add locals Template#inspect Handler, formats, and variant are usually obvious from looking at the identifier. However it's not uncommon to have different locals for the same template so we should make that obvious in inspect. * Add tests for short_identifier and inspect [John Hawthorn + Rafael Mendonça França] --- actionview/test/template/template_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionview/test/template') diff --git a/actionview/test/template/template_test.rb b/actionview/test/template/template_test.rb index 36caef28c2..c74305fb42 100644 --- a/actionview/test/template/template_test.rb +++ b/actionview/test/template/template_test.rb @@ -215,4 +215,14 @@ class TestERBTemplate < ActiveSupport::TestCase ensure silence_warnings { Encoding.default_external = old } end + + def test_short_identifier + @template = new_template("hello") + assert_equal "hello template", @template.short_identifier + end + + def test_template_inspect + @template = new_template("hello") + assert_equal "#", @template.inspect + end end -- cgit v1.2.3