Sha256: c9b5e388e03f26f804f75629df86e1e8781626cf2f8b13ac9f1da4d87e10eb70

Contents?: true

Size: 671 Bytes

Versions: 3

Compression:

Stored size: 671 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Corto" do
  let(:corto) {Corto.new('spec/data/test_db.db')}
  it "should recreate a shortned url db" do
    corto.purge
    corto.count.should == 0
  end
  
  it "should shrink an url" do
    a = corto.shrink('http://www.armoredcode.com')
    a.should.nil? == false
  end
  
  it "should able to reverse a shrink" do
    a = corto.shrink('http://www.armoredcode.com')
    b = corto.deflate(a)
    b.should == "http://www.armoredcode.com"
  end
  
  it "should handle a non existing shrink" do
    a = corto.deflate('this can not be a valid shrinked url')
    a.should.nil? == true
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
corto-0.80.2 spec/corto_spec.rb
corto-0.80.1 spec/corto_spec.rb
corto-0.80.0 spec/corto_spec.rb