summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authornfagerlund <nick.fagerlund@gmail.com>2011-05-26 10:32:22 -0700
committernfagerlund <nick.fagerlund@gmail.com>2011-05-26 11:12:06 -0700
commit996dc076e9ca61613f80fc79f0ffe667b14d1ebb (patch)
tree162867950f0fb2379de1186dbe3afb145f710279 /spec
parent6a1b6e0656c6b3939e48bcd2f558deb343bddb7b (diff)
Maint: Fix ellipses for short descriptions
Previously, we were adding ellipsis to any short_description, which was misleading; they were only necessary when we were truncating in the _middle_ of a paragraph. This commit changes the behavior, and updates the tests to show when we expect ellipsis. Paired-with: Matt Robinson <matt@puppetlabs.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/shared_behaviours/documentation_on_faces.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/shared_behaviours/documentation_on_faces.rb b/spec/shared_behaviours/documentation_on_faces.rb
index 3cfb178f7..1106d4cca 100644
--- a/spec/shared_behaviours/documentation_on_faces.rb
+++ b/spec/shared_behaviours/documentation_on_faces.rb
@@ -109,11 +109,18 @@ shared_examples_for "documentation on faces" do
subject.short_description.should == "hello\ngoodbye"
end
- it "should trim a very, very long first paragraph" do
+ it "should trim a very, very long first paragraph and add ellipsis" do
line = "this is a very, very, very long long line full of text\n"
subject.description = line * 20 + "\n\nwhatever, dude."
- subject.short_description.should == (line * 5).chomp
+ subject.short_description.should == (line * 5).chomp + ' [...]'
+ end
+
+ it "should trim a very very long only paragraph even if it is followed by a new paragraph" do
+ line = "this is a very, very, very long long line full of text\n"
+ subject.description = line * 20
+
+ subject.short_description.should == (line * 5).chomp + ' [...]'
end
end