Sha256: 35c93ec47c0cbb8ddd6b91470e395949a78df4b46899ce5f6789012ea3c99e27

Contents?: true

Size: 490 Bytes

Versions: 11

Compression:

Stored size: 490 Bytes

Contents

require File.join(File.dirname(__FILE__), "../..", "test_helper.rb")

describe "Relevance::CoreExtensions::Object#ellipsize" do
  it "converts nil to empty string" do
    nil.ellipsize.should == ""
  end
  
  it "doesn't touch short strings" do
    "hello".ellipsize.should == "hello"
  end
  
  it "calls inspect on non-strings" do
    [1,2,3].ellipsize.should == "[1, 2, 3]"
  end

  it "shortens long strings and adds ..." do
    "long-string".ellipsize(5).should == "long-..."
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
relevance-tarantula-0.0.1 test/relevance/core_extensions/ellipsize_test.rb
relevance-tarantula-0.0.2 test/relevance/core_extensions/ellipsize_test.rb
relevance-tarantula-0.0.3 test/relevance/core_extensions/ellipsize_test.rb
relevance-tarantula-0.0.5 test/relevance/core_extensions/ellipsize_test.rb
relevance-tarantula-0.0.6 test/relevance/core_extensions/ellipsize_test.rb
relevance-tarantula-0.0.7.1 test/relevance/core_extensions/ellipsize_test.rb
relevance-tarantula-0.0.7 test/relevance/core_extensions/ellipsize_test.rb
relevance-tarantula-0.0.8.0 test/relevance/core_extensions/ellipsize_test.rb
relevance-tarantula-0.0.8.1 test/relevance/core_extensions/ellipsize_test.rb
tarantula-0.0.8.1 test/relevance/core_extensions/ellipsize_test.rb
tarantula-0.0.5 test/relevance/core_extensions/ellipsize_test.rb