Permalink
Browse files

clean up code

  • Loading branch information...
1 parent 326995b commit 09039fdee7d5437a44c847b7f49ce7cceefd2599 @jaimeiniesta committed Nov 17, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/meta_inspector/scraper.rb
  2. +3 −3 spec/metainspector_spec.rb
@@ -41,7 +41,7 @@ def description
# Links found on the page, as absolute URLs
def links
- @data.links ||= parsed_links.map{ |l| absolutify_url(unrelativize_url(l)) }.reject{|l| l.nil? }
+ @data.links ||= parsed_links.map{ |l| absolutify_url(unrelativize_url(l)) }.compact
end
# Internal links found on the page, as absolute URLs
@@ -217,15 +217,15 @@
it "should avoid links that contain invalid links as href value" do
m = MetaInspector.new('http://example.com/invalid_href')
m.links.should == [ "skype:joeuser?call",
- "telnet://telnet.cdrom.com"]
+ "telnet://telnet.cdrom.com"]
end
- it "should throw errors when links contain invalid href values" do
+ it "should store errors when links contain invalid href values" do
m = MetaInspector.new('http://example.com/invalid_href')
expect {
links = m.links
- }.to change { m.errors.size }
+ }.to change { m.errors.size }.from(0).to(1)
m.errors.first.should == "Link parsing exception: bad URI(is not URI?): %3Cp%3Eftp://ftp.cdrom.com"
end

0 comments on commit 09039fd

Please sign in to comment.