mechanize_content 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Rakefile +5 -0
- data/lib/mechanize_content/image.rb +61 -0
- data/lib/mechanize_content/page.rb +115 -0
- data/lib/mechanize_content/util.rb +4 -31
- data/lib/mechanize_content/version.rb +1 -1
- data/lib/mechanize_content.rb +8 -168
- data/mechanize_content.gemspec +2 -1
- data/spec/cassettes/MechanizeContent.yml +33742 -0
- data/spec/cassettes/MechanizeContent_Image.yml +279 -0
- data/spec/mechanize_content/image_spec.rb +39 -0
- data/spec/mechanize_content/page_spec.rb +90 -0
- data/spec/mechanize_content_spec.rb +149 -0
- data/spec/spec_helper.rb +11 -1
- metadata +29 -45
- data/spec/fixtures/a-fistful-of-red-dead-redemption-ps3-for-a-few-dollars-less-on.html +0 -754
- data/spec/fixtures/another-world-15th-anniversary-edition-now-on-gog-com.html +0 -2416
- data/spec/fixtures/another_world_15th_anniversary_edition.html +0 -805
- data/spec/fixtures/cmp.html +0 -333
- data/spec/fixtures/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april.html +0 -1593
- data/spec/fixtures/gdc_2010_rounds_off_indie_cove.html +0 -698
- data/spec/fixtures/google.html +0 -42
- data/spec/fixtures/gta-iv-episodes-from-liberty-city-sees-slight-delay-on-pc-and-ps3.html +0 -1012
- data/spec/fixtures/johnny.jpg +0 -0
- data/spec/fixtures/joystiq-xbox-usb-support-580.jpg +0 -0
- data/spec/fixtures/mutiny.html +0 -264
- data/spec/fixtures/nuff-said-good-old-games-gets-another-world-168150.html +0 -5492
- data/spec/fixtures/rock-band-3-out-this-holiday-will-revolutionize-genre.html +0 -1157
- data/spec/fixtures/rockband_facebook.html +0 -93
- data/spec/fixtures/spartan.html +0 -391
- data/spec/fixtures/techmeme.html +0 -2216
- data/spec/fixtures/time-warner-retail-egm.html +0 -49
- data/spec/fixtures/witcher.html +0 -458
- data/spec/fixtures/xbox-360-gaining-usb-storage-support-in-2010-update.html +0 -2462
- data/spec/mechanize-content_spec.rb +0 -202
@@ -1,202 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
|
-
|
4
|
-
describe "MechanizeContent" do
|
5
|
-
|
6
|
-
def register(url, fixture)
|
7
|
-
FakeWeb.register_uri(:any, url, :response => File.join(File.dirname(__FILE__), 'fixtures', fixture))
|
8
|
-
end
|
9
|
-
|
10
|
-
def register_image(url, fixture)
|
11
|
-
FakeWeb.register_uri(:any, url, :body => File.join(File.dirname(__FILE__), 'fixtures', fixture))
|
12
|
-
end
|
13
|
-
|
14
|
-
before(:all) do
|
15
|
-
register("http://techmeme.com/",'techmeme.html')
|
16
|
-
register("http://www.gog.com/en/gamecard/another_world_15th_anniversary_edition",'another_world_15th_anniversary_edition.html')
|
17
|
-
register("http://www.destructoid.com/-nuff-said-good-old-games-gets-another-world-168150.phtml",'nuff-said-good-old-games-gets-another-world-168150.html')
|
18
|
-
register("http://www.rockstargames.com/newswire/2010/03/18/4061/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april",'episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april.html')
|
19
|
-
register("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601",'cmp.html')
|
20
|
-
register("http://www.gamesetwatch.com/2010/03/gdc_2010_rounds_off_indie_cove.php",'gdc_2010_rounds_off_indie_cove.html')
|
21
|
-
register("http://www.mutinydesign.co.uk/scripts/html-base-tag---1/",'mutiny.html')
|
22
|
-
register("http://www.joystiq.com/2010/03/18/xbox-360-gaining-usb-storage-support-in-2010-update/",'xbox-360-gaining-usb-storage-support-in-2010-update.html')
|
23
|
-
register("http://www.vg247.com/2010/03/18/gta-iv-episodes-from-liberty-city-sees-slight-delay-on-pc-and-ps3/",'gta-iv-episodes-from-liberty-city-sees-slight-delay-on-pc-and-ps3.html')
|
24
|
-
register("http://www.facebook.com/RockBand",'rockband_facebook.html')
|
25
|
-
register("http://www.vg247.com/2010/03/09/rock-band-3-out-this-holiday-will-revolutionize-genre/",'rock-band-3-out-this-holiday-will-revolutionize-genre.html')
|
26
|
-
register("http://www.joystiq.com/2010/03/18/another-world-15th-anniversary-edition-now-on-gog-com/",'another-world-15th-anniversary-edition-now-on-gog-com.html')
|
27
|
-
register("http://www.godofwar.com/spartansstandtall/",'spartan.html')
|
28
|
-
register("http://www.thewitcher.com/",'witcher.html')
|
29
|
-
register("http://www.egmnow.com/press/time-warner-retail-egm.html",'time-warner-retail-egm.html')
|
30
|
-
register("http://www.joystiq.com/2010/07/23/a-fistful-of-red-dead-redemption-ps3-for-a-few-dollars-less-on/",'a-fistful-of-red-dead-redemption-ps3-for-a-few-dollars-less-on.html')
|
31
|
-
|
32
|
-
register_image("http://www.rockstargames.com/rockstar/local_data/US/img/news/eflc_luisjohnny.jpg",'johnny.jpg')
|
33
|
-
register_image("http://www.blogcdn.com/www.joystiq.com/media/2010/03/joystiq-xbox-usb-support-580.jpg",'joystiq-xbox-usb-support-580.jpg')
|
34
|
-
end
|
35
|
-
|
36
|
-
it "initialise mechanize content" do
|
37
|
-
mc = MechanizeContent::Parser.new("http://www.google.com")
|
38
|
-
mc.urls.first.should eql("http://www.google.com")
|
39
|
-
end
|
40
|
-
|
41
|
-
it "fetch the best title" do
|
42
|
-
mc = MechanizeContent::Parser.new("http://techmeme.com/")
|
43
|
-
mc.best_title.should eql("Techmeme")
|
44
|
-
end
|
45
|
-
|
46
|
-
it "page has incorrect class so only url returned" do
|
47
|
-
mc = MechanizeContent::Parser.new("http://techmeme.com/")
|
48
|
-
agent = mock("agent")
|
49
|
-
page = mock("page")
|
50
|
-
page.stub!(:class).and_return(String)
|
51
|
-
agent.should_receive(:get).with("http://techmeme.com/").and_return(page)
|
52
|
-
mc.should_receive(:init_agent).and_return(agent)
|
53
|
-
mc.best_title.should eql("http://techmeme.com/")
|
54
|
-
end
|
55
|
-
|
56
|
-
it "page has no title so only url returned" do
|
57
|
-
mc = MechanizeContent::Parser.new("http://techmeme.com/")
|
58
|
-
agent = mock("agent")
|
59
|
-
page = mock("page")
|
60
|
-
page.stub!(:class).and_return(Mechanize::Page)
|
61
|
-
page.stub!(:title).and_return(nil)
|
62
|
-
agent.should_receive(:get).with("http://techmeme.com/").and_return(page)
|
63
|
-
mc.should_receive(:init_agent).and_return(agent)
|
64
|
-
mc.best_title.should eql("http://techmeme.com/")
|
65
|
-
end
|
66
|
-
|
67
|
-
it "page retrival errors" do
|
68
|
-
mc = MechanizeContent::Parser.new("http://techmeme.com/")
|
69
|
-
agent = mock("agent")
|
70
|
-
page = mock("page")
|
71
|
-
page.stub!(:class).and_return(Mechanize::Page)
|
72
|
-
agent.should_receive(:get).with("http://techmeme.com/").and_raise(Timeout::Error)
|
73
|
-
agent.should_receive(:get).with("http://somewherelse.com/").and_raise(Errno::ECONNRESET)
|
74
|
-
mc.should_receive(:init_agent).any_number_of_times.and_return(agent)
|
75
|
-
|
76
|
-
mc.fetch_page("http://techmeme.com/").should eql(nil)
|
77
|
-
mc.fetch_page("http://somewherelse.com/").should eql(nil)
|
78
|
-
end
|
79
|
-
|
80
|
-
it "mechanize page issues" do
|
81
|
-
mc = MechanizeContent::Parser.new("http://techmeme.com/")
|
82
|
-
agent = mock("agent")
|
83
|
-
page = mock("page")
|
84
|
-
mc.stub!(:init_agent).and_return(agent)
|
85
|
-
page.stub!(:code).and_return(400)
|
86
|
-
agent.should_receive(:get).with("http://techmeme.com/").and_return(page)
|
87
|
-
mc.fetch_page("http://techmeme.com/").should eql(nil)
|
88
|
-
end
|
89
|
-
|
90
|
-
it "fetch some text" do
|
91
|
-
mc = MechanizeContent::Parser.new("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
92
|
-
page = mc.fetch_page("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
93
|
-
mc.fetch_text(page).should eql(nil)
|
94
|
-
|
95
|
-
mc2 = MechanizeContent::Parser.new("http://www.gamesetwatch.com/2010/03/gdc_2010_rounds_off_indie_cove.php")
|
96
|
-
page = mc2.fetch_page("http://www.gamesetwatch.com/2010/03/gdc_2010_rounds_off_indie_cove.php")
|
97
|
-
mc2.fetch_text(page).should eql("Game Developers Conference organizers have confirmed the final set of independent game-specific content, including Ron Carmel on the just-debuted Indie Fund, the Gamma IV party/showcase, and the EGW-replacing Nuovo Sessions game showcase.The newly confirmed details round off a multitude of independent game-specific content at the March 9th-13th event, held at the Moscone Center in San Francisco, including the 12th Annual Independent Games Festival -- featuring over 30 top indie games playable on the GDC Expo floor from Thursday 11th to Saturday 13th, as well as the major IGF Awards on Thursday 11th at 6.30pm.In addition, the 4th Independent Games Summit on Tuesday 9th and Wednesday 10th has added and clarified a number of sessions, with 2D Boy's Ron Carmel kicking off the event with 'Indies and Publishers: Fixing a System That Never Worked', now confirmed to discuss the new Indie Fund organization.Another major new panel, 'Tripping The Art Fantastic', features Spelunky creator Derek Yu, Braid artist David Hellman and Super Meat Boy co-creator Edmund McMillen discussing \"how each one of these figures influences the state of game art, from hand painted epics to short form experimental Flash games.\"")
|
98
|
-
end
|
99
|
-
|
100
|
-
it "find the best text" do
|
101
|
-
mc = MechanizeContent::Parser.new("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
102
|
-
mc.best_text.should eql(nil)
|
103
|
-
|
104
|
-
mc2 = MechanizeContent::Parser.new("http://www.gamesetwatch.com/2010/03/gdc_2010_rounds_off_indie_cove.php")
|
105
|
-
mc2.best_text.should eql("Game Developers Conference organizers have confirmed the final set of independent game-specific content, including Ron Carmel on the just-debuted Indie Fund, the Gamma IV party/showcase, and the EGW-replacing Nuovo Sessions game showcase.The newly confirmed details round off a multitude of independent game-specific content at the March 9th-13th event, held at the Moscone Center in San Francisco, including the 12th Annual Independent Games Festival -- featuring over 30 top indie games playable on the GDC Expo floor from Thursday 11th to Saturday 13th, as well as the major IGF Awards on Thursday 11th at 6.30pm.In addition, the 4th Independent Games Summit on Tuesday 9th and Wednesday 10th has added and clarified a number of sessions, with 2D Boy's Ron Carmel kicking off the event with 'Indies and Publishers: Fixing a System That Never Worked', now confirmed to discuss the new Indie Fund organization.Another major new panel, 'Tripping The Art Fantastic', features Spelunky creator Derek Yu, Braid artist David Hellman and Super Meat Boy co-creator Edmund McMillen discussing \"how each one of these figures influences the state of game art, from hand painted epics to short form experimental Flash games.\"")
|
106
|
-
end
|
107
|
-
|
108
|
-
it "reject all gifs" do
|
109
|
-
mc = MechanizeContent::Parser.new("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
110
|
-
MechanizeContent::Util.valid_image?(500, 500, "http://www.cmpevents.com/GD10/ablank.gif2").should eql(false)
|
111
|
-
end
|
112
|
-
|
113
|
-
it "reject image with banner in the name" do
|
114
|
-
mc = MechanizeContent::Parser.new("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
115
|
-
MechanizeContent::Util.valid_image?(500, 500, "http://www.cmpevents.com/GD10/banner.png").should eql(false)
|
116
|
-
end
|
117
|
-
|
118
|
-
it "reject image that is too small" do
|
119
|
-
mc = MechanizeContent::Parser.new("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
120
|
-
MechanizeContent::Util.valid_image?(64, 500, "http://www.cmpevents.com/GD10/toosmall.png").should eql(false)
|
121
|
-
end
|
122
|
-
|
123
|
-
it "allow good images" do
|
124
|
-
mc = MechanizeContent::Parser.new("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
125
|
-
MechanizeContent::Util.valid_image?(500, 500, "http://www.cmpevents.com/GD10/perfecto.png").should eql(true)
|
126
|
-
end
|
127
|
-
|
128
|
-
it "build a base url for images" do
|
129
|
-
mc = MechanizeContent::Parser.new("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
130
|
-
page = mc.fetch_page("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
131
|
-
MechanizeContent::Util.get_base_url(page.parser, page.uri).to_s.should eql("https://www.cmpevents.com/GD10/a.asp?option=C&V=11&SessID=10601")
|
132
|
-
|
133
|
-
mc = MechanizeContent::Parser.new("http://www.mutinydesign.co.uk/scripts/html-base-tag---1/")
|
134
|
-
page = mc.fetch_page("http://www.mutinydesign.co.uk/scripts/html-base-tag---1/")
|
135
|
-
MechanizeContent::Util.get_base_url(page.parser, page.uri).to_s.should eql("http://www.mutinydesign.co.uk/")
|
136
|
-
end
|
137
|
-
|
138
|
-
it "find image" do
|
139
|
-
mc = MechanizeContent::Parser.new("http://www.rockstargames.com/newswire/2010/03/18/4061/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april")
|
140
|
-
page = mc.fetch_page("http://www.rockstargames.com/newswire/2010/03/18/4061/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april")
|
141
|
-
mc.fetch_image(page).should eql("http://www.rockstargames.com/rockstar/local_data/US/img/news/eflc_luisjohnny.jpg")
|
142
|
-
|
143
|
-
mc3 = MechanizeContent::Parser.new("http://www.gog.com/en/gamecard/another_world_15th_anniversary_edition")
|
144
|
-
page3 = mc3.fetch_page("http://www.gog.com/en/gamecard/another_world_15th_anniversary_edition")
|
145
|
-
mc3.fetch_image(page3).should eql(nil)
|
146
|
-
|
147
|
-
mc4 = MechanizeContent::Parser.new("http://www.gog.com/page_has_no_content")
|
148
|
-
page4 = mock("page")
|
149
|
-
mc4.stub!(:fetch_content).with(page4).and_return(nil)
|
150
|
-
mc4.fetch_image(page4).should eql(nil)
|
151
|
-
|
152
|
-
mc5 = MechanizeContent::Parser.new("http://www.egmnow.com/press/time-warner-retail-egm.html")
|
153
|
-
page5 = mc5.fetch_page("http://www.egmnow.com/press/time-warner-retail-egm.html")
|
154
|
-
mc5.fetch_image(page5).should eql("http://www.egmnow.com/images/egmlogo.jpg")
|
155
|
-
end
|
156
|
-
|
157
|
-
it "find the best image" do
|
158
|
-
mc = MechanizeContent::Parser.new("http://www.rockstargames.com/newswire/2010/03/18/4061/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april")
|
159
|
-
mc.best_image.should eql("http://www.rockstargames.com/rockstar/local_data/US/img/news/eflc_luisjohnny.jpg")
|
160
|
-
|
161
|
-
mc3 = MechanizeContent::Parser.new("http://www.gog.com/en/gamecard/another_world_15th_anniversary_edition")
|
162
|
-
mc3.best_image.should eql(nil)
|
163
|
-
end
|
164
|
-
|
165
|
-
it "can handle arrays" do
|
166
|
-
mc = MechanizeContent::Parser.new(["http://www.rockstargames.com/newswire/2010/03/18/4061/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april", "http://www.vg247.com/2010/03/18/gta-iv-episodes-from-liberty-city-sees-slight-delay-on-pc-and-ps3/"])
|
167
|
-
mc.best_title.should eql("Rockstar Games | Rockstar News Wire | Episodes from Liberty City Now Coming to PlayStation 3 and PC this April")
|
168
|
-
mc.best_text.should eql("Due to a last minute game submission request from Sony Computer Entertainment Europe to edit some of the in-game Liberty City radio station, television, and internet content – we are forced to delay the worldwide release of Grand Theft Auto: Episodes from Liberty City for both PlayStation 3 and PC for an extra two weeks.\rThe new release date for Episodes from Liberty City - and the two downloadable episodes The Lost and Damned and The Ballad of Gay Tony - on those platforms is now April 13th in North America and April 16th in Europe. This new date will enable us to rectify these changes for Sony Europe, and still allow for a level playing field for all of the Grand Theft Auto fans that have been waiting patiently for this release. In the meantime, we’re moving full speed ahead towards the new game release date. On that note – please be aware that the Grand Theft Auto IV PlayStation 3 leaderboards at Rockstar Games Social Club will be down for maintenance for one week starting March 22nd as we work on their re-launch in support of Episodes from Liberty City.\rBelow are answers to some additional questions that we know some of you may have…\rThose game changes sound pretty minor. Why does the game have to be delayed a whole two weeks?\rUnfortunately, with each round of changes comes fully re-testing the game and a full re-submission to PlayStation. This is the nature of the game submission process. Believe us, if we could expedite the turnaround any sooner – we would. We are dying to get this game in the hands of fans who’ve waited for it for so long in the first place.Why is content being edited just for the European release? This doesn’t seem fair.\rThere are different regional requirements for content – whether dictated by ratings boards like the ESRB and BBFC or by SCEE – this is pretty standard in the world of entertainment.\rIf this content is only being edited for the PlayStation 3 release, and only in Europe… why does everyone in North America etc have to wait? And why do PC players have to wait at all?\rThis was a tough decision but with a simultaneous release, everyone can experience multiplayer simultaneously, take part in online events together, be on level ground on leaderboards, etc. What about those Episodes from Liberty City PSN and GFWL Social Club multiplayer events you announced for April 2nd and 3rd? \rThe first Episodes events for those systems will now be on April 16th and 17th. We will most likely replace the originally scheduled early April events with one for another game. Any requests?\rAny other questions, please feel to leave in the Comments area and we’ll do our best to answer. While this sort of thing may be commonplace in the world of interactive entertainment, we know that game delays are as disappointing to you all as they are to us – and we thank all of our fans immensely for their patience and understanding.\rRockstar Games")
|
169
|
-
mc.best_image.should eql("http://www.rockstargames.com/rockstar/local_data/US/img/news/eflc_luisjohnny.jpg")
|
170
|
-
end
|
171
|
-
|
172
|
-
it "find the best content from multiple urls" do
|
173
|
-
mc = MechanizeContent::Parser.new("http://www.rockstargames.com/newswire/2010/03/18/4061/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april", "http://www.vg247.com/2010/03/18/gta-iv-episodes-from-liberty-city-sees-slight-delay-on-pc-and-ps3/")
|
174
|
-
mc.best_title.should eql("Rockstar Games | Rockstar News Wire | Episodes from Liberty City Now Coming to PlayStation 3 and PC this April")
|
175
|
-
mc.best_text.should eql("Due to a last minute game submission request from Sony Computer Entertainment Europe to edit some of the in-game Liberty City radio station, television, and internet content – we are forced to delay the worldwide release of Grand Theft Auto: Episodes from Liberty City for both PlayStation 3 and PC for an extra two weeks.\rThe new release date for Episodes from Liberty City - and the two downloadable episodes The Lost and Damned and The Ballad of Gay Tony - on those platforms is now April 13th in North America and April 16th in Europe. This new date will enable us to rectify these changes for Sony Europe, and still allow for a level playing field for all of the Grand Theft Auto fans that have been waiting patiently for this release. In the meantime, we’re moving full speed ahead towards the new game release date. On that note – please be aware that the Grand Theft Auto IV PlayStation 3 leaderboards at Rockstar Games Social Club will be down for maintenance for one week starting March 22nd as we work on their re-launch in support of Episodes from Liberty City.\rBelow are answers to some additional questions that we know some of you may have…\rThose game changes sound pretty minor. Why does the game have to be delayed a whole two weeks?\rUnfortunately, with each round of changes comes fully re-testing the game and a full re-submission to PlayStation. This is the nature of the game submission process. Believe us, if we could expedite the turnaround any sooner – we would. We are dying to get this game in the hands of fans who’ve waited for it for so long in the first place.Why is content being edited just for the European release? This doesn’t seem fair.\rThere are different regional requirements for content – whether dictated by ratings boards like the ESRB and BBFC or by SCEE – this is pretty standard in the world of entertainment.\rIf this content is only being edited for the PlayStation 3 release, and only in Europe… why does everyone in North America etc have to wait? And why do PC players have to wait at all?\rThis was a tough decision but with a simultaneous release, everyone can experience multiplayer simultaneously, take part in online events together, be on level ground on leaderboards, etc. What about those Episodes from Liberty City PSN and GFWL Social Club multiplayer events you announced for April 2nd and 3rd? \rThe first Episodes events for those systems will now be on April 16th and 17th. We will most likely replace the originally scheduled early April events with one for another game. Any requests?\rAny other questions, please feel to leave in the Comments area and we’ll do our best to answer. While this sort of thing may be commonplace in the world of interactive entertainment, we know that game delays are as disappointing to you all as they are to us – and we thank all of our fans immensely for their patience and understanding.\rRockstar Games")
|
176
|
-
mc.best_image.should eql("http://www.rockstargames.com/rockstar/local_data/US/img/news/eflc_luisjohnny.jpg")
|
177
|
-
|
178
|
-
mc = MechanizeContent::Parser.new("http://www.facebook.com/RockBand", "http://www.vg247.com/2010/03/09/rock-band-3-out-this-holiday-will-revolutionize-genre/")
|
179
|
-
mc.best_title.should eql("Rock Band | Facebook")
|
180
|
-
mc.best_text.should eql("Harmonix just confirmed that Rock Band 3 will release this holiday season.Said the firm on Rock Band’s Facebook page:“Harmonix is developing Rock Band 3 for worldwide release this holiday season! The game, which will be published by MTV Games and distributed by Electronic Arts, will innovate and revolutionize the music genre once again, just as Harmonix did with the original Rock Band, Rock Band 2 and The Beatles: Rock Band. Stay tuned for more details!”There’s no more detail right now, but keep watching for updates from GDC.")
|
181
|
-
mc.best_image.should eql("http://assets.vg247.com/current//2010/03/rockbandlogo.jpg")
|
182
|
-
end
|
183
|
-
|
184
|
-
it "gog link no text" do
|
185
|
-
mc = MechanizeContent::Parser.new("http://www.gog.com/en/gamecard/another_world_15th_anniversary_edition", "http://www.destructoid.com/-nuff-said-good-old-games-gets-another-world-168150.phtml", "http://www.joystiq.com/2010/03/18/another-world-15th-anniversary-edition-now-on-gog-com/")
|
186
|
-
mc.best_title.should eql("Another World: 15th Anniversary Edition - GOG.com")
|
187
|
-
mc.best_text.should eql("Another World -- or Out of this World, as many of you will know it by -- is now on DRM-free digital distribution service Good Old Games. It can be had for $9.99. Need I say more?\rI love the game, even though I have never made it more than oh, five minutes in. It's more or less universally loved by the Destructoid staff. Not long after we got an email detailing the good news, the thread soon reached fifteen or so replies full of praise for the game.\rOther, less exciting recent releases include: Empire Earth II Gold, Gabriel Knight 3, and Aquanox. Not to completely s**t on these games, but this is Another World we're talking about here.")
|
188
|
-
end
|
189
|
-
|
190
|
-
it "getting wrong blurb from detructoid" do
|
191
|
-
mc = MechanizeContent::Parser.new("http://www.destructoid.com/-nuff-said-good-old-games-gets-another-world-168150.phtml")
|
192
|
-
mc.best_title.should eql("'Nuff said: Good Old Games gets Another World- Destructoid")
|
193
|
-
mc.best_text.should eql("Another World -- or Out of this World, as many of you will know it by -- is now on DRM-free digital distribution service Good Old Games. It can be had for $9.99. Need I say more?\rI love the game, even though I have never made it more than oh, five minutes in. It's more or less universally loved by the Destructoid staff. Not long after we got an email detailing the good news, the thread soon reached fifteen or so replies full of praise for the game.\rOther, less exciting recent releases include: Empire Earth II Gold, Gabriel Knight 3, and Aquanox. Not to completely s**t on these games, but this is Another World we're talking about here.")
|
194
|
-
mc.best_image.should eql(nil)
|
195
|
-
end
|
196
|
-
|
197
|
-
it "get this flash site to return nil for a title" do
|
198
|
-
mc = MechanizeContent::Parser.new("http://www.thewitcher.com/")
|
199
|
-
mc.best_text.should eql(nil)
|
200
|
-
end
|
201
|
-
|
202
|
-
end
|