diff options
author | Matthew Draper <matthew@trebex.net> | 2017-05-06 20:35:14 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-06 20:35:14 +0930 |
commit | e5434b038985906f17b3663766a0588dd8998b17 (patch) | |
tree | 735b04ab7f03ed0aca7b6a0dafae9f55809d41bb /activerecord/test | |
parent | d69dfdc6d304ca2aef7a08c625f8ca9811e539ca (diff) | |
parent | ae73637e35db20d0c4e14959d8c1274e5399278e (diff) | |
download | rails-e5434b038985906f17b3663766a0588dd8998b17.tar.gz rails-e5434b038985906f17b3663766a0588dd8998b17.tar.bz2 rails-e5434b038985906f17b3663766a0588dd8998b17.zip |
Merge pull request #28989 from matthewd/quoted_id-deprecation
Clarify deprecation message for #quoted_id
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/quoting_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/activerecord/test/cases/quoting_test.rb b/activerecord/test/cases/quoting_test.rb index f260d043e4..f647526fbc 100644 --- a/activerecord/test/cases/quoting_test.rb +++ b/activerecord/test/cases/quoting_test.rb @@ -81,8 +81,21 @@ module ActiveRecord end end + class QuotedOne + def quoted_id + 1 + end + end + class SubQuotedOne < QuotedOne + end def test_quote_with_quoted_id - assert_deprecated { assert_equal 1, @quoter.quote(Struct.new(:quoted_id).new(1)) } + assert_deprecated /defined on \S+::QuotedOne at .*quoting_test\.rb:[0-9]/ do + assert_equal 1, @quoter.quote(QuotedOne.new) + end + + assert_deprecated /defined on \S+::SubQuotedOne\(\S+::QuotedOne\) at .*quoting_test\.rb:[0-9]/ do + assert_equal 1, @quoter.quote(SubQuotedOne.new) + end end def test_quote_nil |