Sha256: 0adee9be1130f8cc1a46743229ca9541f75fcce239d3c5fdebde1edec57986fb

Contents?: true

Size: 786 Bytes

Versions: 11

Compression:

Stored size: 786 Bytes

Contents

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

describe "domainatrix" do
  it "should parse into a url object" do
    Domainatrix.parse("http://pauldix.net").should be_a Domainatrix::Url
  end

  it "should canonicalize" do
    Domainatrix.parse("http://pauldix.net").canonical.should == "net.pauldix"
    Domainatrix.parse("http://pauldix.net/foo.html").canonical.should == "net.pauldix/foo.html"
    Domainatrix.parse("http://pauldix.net/foo.html?asdf=bar").canonical.should == "net.pauldix/foo.html?asdf=bar"
    Domainatrix.parse("http://foo.pauldix.net").canonical.should == "net.pauldix.foo"
    Domainatrix.parse("http://foo.bar.pauldix.net").canonical.should == "net.pauldix.bar.foo"
    Domainatrix.parse("http://pauldix.co.uk").canonical.should == "uk.co.pauldix"
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
f1sherman-domainatrix-0.0.10 spec/domainatrix_spec.rb
domainatrix-0.0.10 spec/domainatrix_spec.rb
domainatrix-0.0.9 spec/domainatrix_spec.rb
domainatrix-0.0.8 spec/domainatrix_spec.rb
domainatrix-0.0.7 spec/domainatrix_spec.rb
domainatrix-0.0.6 spec/domainatrix_spec.rb
domainatrix-0.0.5 spec/domainatrix_spec.rb
domainatrix-0.0.4 spec/domainatrix_spec.rb
domainatrix-0.0.3 spec/domainatrix_spec.rb
domainatrix-0.0.2 spec/domainatrix_spec.rb
domainatrix-0.0.1 spec/domainatrix_spec.rb