From b54560600b06112723adf286141a9cd7ed67b638 Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Mon, 26 Sep 2005 20:49:52 +0000 Subject: Have text helpers use built in Regexp.escape rather than home grown alternative git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2350 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/text_helper_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/test/template/text_helper_test.rb') diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 856c32c300..3eb70eadae 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -100,7 +100,13 @@ class TextHelperTest < Test::Unit::TestCase assert_equal("...iful morning", excerpt("This is a beautiful morning", "morning", 5)) assert_nil excerpt("This is a beautiful morning", "day") end + + def test_excerpt_with_regex + assert_equal('...is a beautiful! morn...', excerpt('This is a beautiful! morning', 'beautiful', 5)) + assert_equal('...is a beautiful? morn...', excerpt('This is a beautiful? morning', 'beautiful', 5)) + end + def test_word_wrap assert_equal("my very very\nvery long\nstring", word_wrap("my very very very long string", 15)) end -- cgit v1.2.3