domainatrix 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/domainatrix/url.rb +6 -0
- data/lib/domainatrix.rb +1 -1
- data/spec/domainatrix/url_spec.rb +13 -0
- metadata +1 -1
data/lib/domainatrix/url.rb
CHANGED
data/lib/domainatrix.rb
CHANGED
@@ -38,4 +38,17 @@ describe "url" do
|
|
38
38
|
it "canonicalizes the url without the path" do
|
39
39
|
Domainatrix::Url.new(:subdomain => "foo", :domain => "pauldix", :public_suffix => "net").canonical(:include_path => false).should == "net.pauldix.foo"
|
40
40
|
end
|
41
|
+
|
42
|
+
it "combines the domain with the public_suffix" do
|
43
|
+
Domainatrix::Url.new(:domain => "pauldix", :public_suffix => "net").domain_with_public_suffix.should == "pauldix.net"
|
44
|
+
Domainatrix::Url.new(:domain => "foo", :public_suffix => "co.uk" ).domain_with_public_suffix.should == "foo.co.uk"
|
45
|
+
Domainatrix::Url.new(:subdomain => "baz", :domain => "bar", :public_suffix => "com").domain_with_public_suffix.should == "bar.com"
|
46
|
+
end
|
47
|
+
|
48
|
+
it "combines the domain with the public_suffix as an alias" do
|
49
|
+
Domainatrix::Url.new(:domain => "pauldix", :public_suffix => "net").domain_with_tld.should == "pauldix.net"
|
50
|
+
Domainatrix::Url.new(:domain => "foo", :public_suffix => "co.uk" ).domain_with_tld.should == "foo.co.uk"
|
51
|
+
Domainatrix::Url.new(:subdomain => "baz", :domain => "bar", :public_suffix => "com").domain_with_tld.should == "bar.com"
|
52
|
+
end
|
53
|
+
|
41
54
|
end
|