Skip to content

Instantly share code, notes, and snippets.

@eladmeidar
Created August 10, 2009 02:43
Show Gist options
  • Save eladmeidar/164987 to your computer and use it in GitHub Desktop.
Save eladmeidar/164987 to your computer and use it in GitHub Desktop.
def test_truncate_multibyte_with_seperator
with_kcode 'none' do
assert_equal "אלעד ...", truncate("אלעד אוכל גזר כתום", :seperator => ' ', :length => 12)
end
with_kcode 'u' do
assert_equal "אלעד ...",
truncate("אלעד אוכלת גזר כתום", :length => 10, :seperator => ' ')
end
end
1) Failure:
test_truncate_multibyte_with_seperator(TextHelperTest)
[./test/template/text_helper_test.rb:77:in `test_truncate_multibyte_with_seperator'
./test/testing_sandbox.rb:7:in `with_kcode'
./test/template/text_helper_test.rb:76:in `test_truncate_multibyte_with_seperator'
./test/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `__send__'
./test/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run']:
<"אלעד ..."> expected but was
<"אלעד או...">.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment