Sha256: 2e899323fcc6cac178974785ccf3600a79a6347596a5fc4abb1a42798065fe0b
Contents?: true
Size: 460 Bytes
Versions: 6
Compression:
Stored size: 460 Bytes
Contents
require 'spec_helper' describe "String" do before :each do @str = "This is a fairly long string to test with!" end it "should default to appending ..." do @str.truncate(5).should == "Th..." end it "should default to a length of 30" do @str.truncate().should == "This is a fairly long strin..." end it "should truncate to a given length with a given suffix" do @str.truncate(15, "--more").should == "This is a--more" end end
Version data entries
6 entries across 6 versions & 1 rubygems