summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_text.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_text.rb')
-rw-r--r--test/rubygems/test_gem_text.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_text.rb b/test/rubygems/test_gem_text.rb
index 775f1e9..7324e42 100644
--- a/test/rubygems/test_gem_text.rb
+++ b/test/rubygems/test_gem_text.rb
@@ -26,6 +26,21 @@ class TestGemText < Gem::TestCase
assert_equal " text to wrap", format_text("text to wrap", 40, 2)
end
+ def test_format_text_trailing # for two spaces after .
+ text = <<-TEXT
+This line is really, really long. So long, in fact, that it is more than eighty characters long! The purpose of this line is for testing wrapping behavior because sometimes people don't wrap their text to eighty characters. Without the wrapping, the text might not look good in the RSS feed.
+ TEXT
+
+ expected = <<-EXPECTED
+This line is really, really long. So long, in fact, that it is more than
+eighty characters long! The purpose of this line is for testing wrapping
+behavior because sometimes people don't wrap their text to eighty characters.
+Without the wrapping, the text might not look good in the RSS feed.
+ EXPECTED
+
+ assert_equal expected, format_text(text, 78)
+ end
+
def test_levenshtein_distance_add
assert_equal 2, levenshtein_distance("zentest", "zntst")
assert_equal 2, levenshtein_distance("zntst", "zentest")