metainspector 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/meta_inspector/scraper.rb +11 -4
- data/lib/meta_inspector/version.rb +1 -1
- data/spec/fixtures/youtube.response +1870 -0
- data/spec/metainspector_spec.rb +15 -0
- metadata +5 -4
data/spec/metainspector_spec.rb
CHANGED
@@ -13,6 +13,7 @@ describe MetaInspector do
|
|
13
13
|
FakeWeb.register_uri(:get, "http://protocol-relative.com", :response => fixture_file("protocol_relative.response"))
|
14
14
|
FakeWeb.register_uri(:get, "https://protocol-relative.com", :response => fixture_file("protocol_relative.response"))
|
15
15
|
FakeWeb.register_uri(:get, "http://example.com/nonhttp", :response => fixture_file("nonhttp.response"))
|
16
|
+
FakeWeb.register_uri(:get, "http://www.youtube.com/watch?v=iaGSSrp49uc", :response => fixture_file("youtube.response"))
|
16
17
|
|
17
18
|
describe 'Initialization' do
|
18
19
|
it 'should accept an URL with a scheme' do
|
@@ -229,4 +230,18 @@ describe MetaInspector do
|
|
229
230
|
@m.to_hash.should == {"title"=>"PageRankAlert.com :: Track your PageRank changes", "url"=>"http://pagerankalert.com", "meta"=>{"name"=>{"robots"=>"all,follow", "csrf_param"=>"authenticity_token", "description"=>"Track your PageRank(TM) changes and receive alerts by email", "keywords"=>"pagerank, seo, optimization, google", "csrf_token"=>"iW1/w+R8zrtDkhOlivkLZ793BN04Kr3X/pS+ixObHsE="}, "property"=>{}}, "links"=>["/", "/es?language=es", "/users/sign_up", "/users/sign_in", "mailto:pagerankalert@gmail.com", "http://pagerankalert.posterous.com", "http://twitter.com/pagerankalert", "http://twitter.com/share"], "charset"=>"utf-8", "feed"=>"http://feeds.feedburner.com/PageRankAlert", "absolute_links"=>["http://pagerankalert.com/", "http://pagerankalert.com/es?language=es", "http://pagerankalert.com/users/sign_up", "http://pagerankalert.com/users/sign_in", "mailto:pagerankalert@gmail.com", "http://pagerankalert.posterous.com", "http://twitter.com/pagerankalert", "http://twitter.com/share"]}
|
230
231
|
end
|
231
232
|
end
|
233
|
+
|
234
|
+
describe "regression tests" do
|
235
|
+
describe "get image" do
|
236
|
+
it "should find image on youtube" do
|
237
|
+
MetaInspector.new('http://www.youtube.com/watch?v=iaGSSrp49uc').image.should == "http://i2.ytimg.com/vi/iaGSSrp49uc/mqdefault.jpg"
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
describe "get description" do
|
242
|
+
it "should find description on youtube" do
|
243
|
+
MetaInspector.new('http://www.youtube.com/watch?v=iaGSSrp49uc').description.should == ""
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
232
247
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metainspector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 1.9.
|
9
|
+
- 2
|
10
|
+
version: 1.9.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jaime Iniesta
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-13 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: nokogiri
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- spec/fixtures/tea-tron.com.response
|
163
163
|
- spec/fixtures/theonion-no-description.com.response
|
164
164
|
- spec/fixtures/theonion.com.response
|
165
|
+
- spec/fixtures/youtube.response
|
165
166
|
- spec/metainspector_spec.rb
|
166
167
|
- spec/spec_helper.rb
|
167
168
|
homepage: https://github.com/jaimeiniesta/metainspector
|