This commit is contained in:
Christian Mehlmauer
2013-08-12 22:01:24 +02:00
parent 8896f8bf79
commit d107613e40
3 changed files with 24 additions and 2 deletions

View File

@@ -40,8 +40,12 @@ class WebSite
end
entries.each do |d|
temp = @uri.clone
temp.path = d
begin
temp = @uri.clone
temp.path = d
rescue URI::Error
temp = d
end
return_object << temp.to_s
end
end

View File

@@ -0,0 +1,8 @@
User-agent: *
Disallow: /wp-admin/
Disallow: http://10.0.0.0/wp-includes/
Disallow: wooooza
Disallow: /ÖÜ()=?
Allow: /asdf/
Sitemap: http://10.0.0.0/sitemap.xml.gz

View File

@@ -40,6 +40,16 @@ shared_examples 'WebSite::RobotsTxt' do
@expected = []
end
it 'returns some urls and some strings' do
@fixture = fixtures_dir + '/robots_txt/invalid_robots_2.txt'
@expected = %w(
/ÖÜ()=?
http://10.0.0.0/wp-includes/
http://example.localhost/asdf/
wooooza
)
end
it 'returns an Array of urls (valid robots.txt)' do
@fixture = fixtures_dir + '/robots_txt/robots.txt'
@expected = %w(