Deprecate old APIs for highlight, excerpt and word_wrap #6377

Merged
merged 1 commit into from May 18, 2012

Projects

None yet

2 participants

@iHiD
Contributor
iHiD commented May 18, 2012

Deprecation messages to go with #6371 (cc @rafaelfranca)

@rafaelfranca rafaelfranca and 1 other commented on an outdated diff May 18, 2012
actionpack/test/template/text_helper_test.rb
@@ -118,10 +118,12 @@ def test_highlight
highlight("This is a beautiful morning, but also a beautiful day", "beautiful")
)
- assert_equal(
- "This is a <b>beautiful</b> morning, but also a <b>beautiful</b> day",
- highlight("This is a beautiful morning, but also a beautiful day", "beautiful", '<b>\1</b>')
- )
+ ActiveSupport::Deprecation.silence do
@rafaelfranca
rafaelfranca May 18, 2012 Member

Use the assert_deprecation(message) { }

@iHiD
iHiD May 18, 2012 Contributor

Done. I've added tests for each to keep it cleaner.

@rafaelfranca
rafaelfranca May 18, 2012 Member

I think that we should use the newer API in the tests that is not asserting the deprecation message, and remove these ActiveSupport::Deprecation.silence blocks

@iHiD
iHiD May 18, 2012 Contributor

Makes sense. Done.

@rafaelfranca
Member

Remember to squash the commits

@iHiD
Contributor
iHiD commented May 18, 2012

Yet another new Git skill learned. Done :)

@rafaelfranca rafaelfranca merged commit 2802ad0 into rails:3-2-stable May 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment