fix issue #262
This commit is contained in:
@@ -40,8 +40,12 @@ class WebSite
|
|||||||
end
|
end
|
||||||
|
|
||||||
entries.each do |d|
|
entries.each do |d|
|
||||||
temp = @uri.clone
|
begin
|
||||||
temp.path = d
|
temp = @uri.clone
|
||||||
|
temp.path = d
|
||||||
|
rescue URI::Error
|
||||||
|
temp = d
|
||||||
|
end
|
||||||
return_object << temp.to_s
|
return_object << temp.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -40,6 +40,16 @@ shared_examples 'WebSite::RobotsTxt' do
|
|||||||
@expected = []
|
@expected = []
|
||||||
end
|
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
|
it 'returns an Array of urls (valid robots.txt)' do
|
||||||
@fixture = fixtures_dir + '/robots_txt/robots.txt'
|
@fixture = fixtures_dir + '/robots_txt/robots.txt'
|
||||||
@expected = %w(
|
@expected = %w(
|
||||||
|
|||||||
Reference in New Issue
Block a user