Sha256: 003ebb8c865f3a06305ebec411c9cc4208fd47521f312af51975d4a3bb46d900

Contents?: true

Size: 444 Bytes

Versions: 11

Compression:

Stored size: 444 Bytes

Contents

require "spec_helper"

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
codez-tarantula-0.5.5 spec/relevance/core_extensions/ellipsize_spec.rb
codez-tarantula-0.5.4 spec/relevance/core_extensions/ellipsize_spec.rb
codez-tarantula-0.5.3 spec/relevance/core_extensions/ellipsize_spec.rb
codez-tarantula-0.5.1 spec/relevance/core_extensions/ellipsize_spec.rb
codez-tarantula-0.5.0 spec/relevance/core_extensions/ellipsize_spec.rb
tarantula-0.5.1 spec/relevance/core_extensions/ellipsize_spec.rb
tarantula-0.5.0 spec/relevance/core_extensions/ellipsize_spec.rb
tarantula-0.4.3 spec/relevance/core_extensions/ellipsize_spec.rb
tarantula-0.4.2 spec/relevance/core_extensions/ellipsize_spec.rb
tarantula-0.4.1 spec/relevance/core_extensions/ellipsize_spec.rb
tarantula-0.4.0 spec/relevance/core_extensions/ellipsize_spec.rb