Sha256: 877ef4b7ba15148da4bd4dd3eb0379fe1ef548b176d6ecfb9a3f0fb921bb59b5
Contents?: true
Size: 714 Bytes
Versions: 13
Compression:
Stored size: 714 Bytes
Contents
require "spec_helper" require "calagator/url_prefixer" module Calagator describe UrlPrefixer do it "adds an http prefix to urls missing it" do url = UrlPrefixer.prefix("google.com") url.should == "http://google.com" end it "leaves urls with an existing scheme alone" do url = UrlPrefixer.prefix("https://google.com") url.should == "https://google.com" end it "leaves blank urls alone" do url = UrlPrefixer.prefix(" ") url.should == " " end it "leaves nil urls alone" do url = UrlPrefixer.prefix(nil) url.should == nil end it "avoids whitespace inside url" do url = UrlPrefixer.prefix(" google.com ") url.should == "http://google.com " end end end
Version data entries
13 entries across 13 versions & 2 rubygems