From b5c344d848e68e95cead2490a8a1914cede90cb6 Mon Sep 17 00:00:00 2001 From: Jeremy Olliver Date: Sun, 8 Mar 2009 20:09:06 +1300 Subject: [PATCH] Updating tests to fail, where behavior is not as expected --- actionpack/test/template/text_helper_test.rb | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 4e209f3..0b40cff 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -36,27 +36,27 @@ class TextHelperTest < ActionView::TestCase def test_truncate assert_equal "Hello World!", truncate("Hello World!", :length => 12) - assert_equal "Hell…", truncate("Hello World!!", :length => 12) + assert_equal "Hello Wor…", truncate("Hello World!!", :length => 12) end def test_truncate_should_use_default_length_of_30 str = "This is a string that will go longer then the default truncate length of 30" - assert_equal str[0...22] + "…", truncate(str) + assert_equal str[0...27] + "…", truncate(str) end def test_truncate_with_options_hash assert_equal "This is a string that wil[...]", truncate("This is a string that will go longer then the default truncate length of 30", :omission => "[...]") - assert_equal "He…", truncate("Hello World!", :length => 10) + assert_equal "Hello W…", truncate("Hello World!", :length => 10) assert_equal "Hello[...]", truncate("Hello World!", :omission => "[...]", :length => 10) end if RUBY_VERSION < '1.9.0' def test_truncate_multibyte with_kcode 'none' do - assert_equal "\354\225\210\353\205\225…", truncate("\354\225\210\353\205\225\355\225\230\354\204\270\354\232\224", :length => 14) + assert_equal "\354\225\210\353\205\225\355\225\230\354\204…", truncate("\354\225\210\353\205\225\355\225\230\354\204\270\354\232\224", :length => 14) end with_kcode 'u' do - assert_equal "\354\225\204\353\246\254…", + assert_equal "\354\225\204\353\246\254\353…", truncate("\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254 \354\225\204\353\235\274\353\246\254\354\230\244", :length => 10) end end -- 1.5.6