spec/postrank-uri_spec.rb in postrank-uri-1.0.15 vs spec/postrank-uri_spec.rb in postrank-uri-1.0.16
- old
+ new
@@ -224,10 +224,14 @@
it "should extract twitter links with hashbangs" do
e('test http://twitter.com/#!/igrigorik').should include('http://twitter.com/igrigorik')
end
+ it "should extract mobile twitter links with hashbangs" do
+ e('test http://mobile.twitter.com/#!/_mm6').should include('http://mobile.twitter.com/_mm6')
+ end
+
it "should handle a URL that comes after text without a space" do
e("text:http://spn.tw/tfnLT").should include("http://spn.tw/tfnLT")
e("text;http://spn.tw/tfnLT").should include("http://spn.tw/tfnLT")
e("text.http://spn.tw/tfnLT").should include("http://spn.tw/tfnLT")
e("text-http://spn.tw/tfnLT").should include("http://spn.tw/tfnLT")
@@ -329,8 +333,18 @@
PostRank::URI.parse('mailto:void(0);').scheme.should == 'mailto'
end
it 'should not pancake xmpp scheme URIs' do
PostRank::URI.parse('xmpp:void(0);').scheme.should == 'xmpp'
+ end
+ end
+
+ context 'valid?' do
+ it 'marks www.test.c as invalid' do
+ PostRank::URI.valid?('http://www.test.c').should be_false
+ end
+
+ it 'marks www.test.com as valid' do
+ PostRank::URI.valid?('http://www.test.com').should be_true
end
end
end