spec/unit/truncate/truncate_spec.rb in strings-0.1.6 vs spec/unit/truncate/truncate_spec.rb in strings-0.1.7
- old
+ new
@@ -9,9 +9,13 @@
it "doensn't change text for nil length" do
expect(Strings::Truncate.truncate(text, nil)).to eq(text)
end
+ it "truncate length of 1 results in just the trailing character" do
+ expect(Strings::Truncate.truncate(text, 1)).to eq(Strings::Truncate::DEFAULT_TRAILING)
+ end
+
it "doesn't change text for equal length" do
truncation = Strings::Truncate.truncate(text, text.length * 2)
expect(truncation).to eq(text)
end