Permalink
Browse files

refactor mock scraper tests to external fixtures

  • Loading branch information...
tardate committed Dec 30, 2011
1 parent 4e4a063 commit f0ab4329088c5515d79c4b72a624c5a254e798ff

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,14 @@
+<html>
+ <head>
+ <title>Index of /</title>
+ </head>
+ <body>
+ <h2>Index of /</h2>
+ <table cellpadding="4" width="100%" border="0">
+ <tr><td>&nbsp;</td><td><b>Name</b></td><td><b>Size</b></td><td><b>Kind</b></td><td><b>Last Modified</b></td></tr>
+
+ <tr><td colspan="5"><hr noshade></td></tr>
+ <tr><td colspan="5"><hr noshade></td></tr>
+ </table>
+ </body>
+</html>
@@ -20,7 +20,7 @@
let(:show_number) { 333 }
subject { scraper_control.load_show(show_number) }
before {
- Navd::Scraper::Spider.any_instance.stub(:get_page).and_return(Nokogiri::HTML(published_show_page_html))
+ Navd::Scraper::Spider.any_instance.stub(:get_page).and_return(published_show_page_html)
Navd::Scraper::ShowLoader.any_instance.stub(:show_notes).and_return([])
Navd::Scraper::ShowLoader.any_instance.stub(:credits_list).and_return(nil)
}
@@ -31,7 +31,7 @@
:name=>nil
} }
before {
- show_loader.spider.stub(:get_page).and_return(Nokogiri::HTML(published_show_page_html))
+ show_loader.spider.stub(:get_page).and_return(published_show_page_html)
show_loader.stub(:show_notes).and_return([])
show_loader.stub(:credits_list).and_return(nil)
show_loader.scan_show_assets
@@ -49,7 +49,7 @@
context "parsing shownotes menu" do
before {
- show_loader.stub(:p_shownotes_menu).and_return(Nokogiri::HTML(shownotes_menu_page_html))
+ show_loader.stub(:p_shownotes_menu).and_return(shownotes_menu_page_html)
}
describe "#shownotes_detail_main_uri [protected]" do
subject { show_loader.send(:shownotes_detail_main_uri) }
@@ -66,7 +66,7 @@
context "parsing credits" do
before {
- show_loader.stub(:p_credits).and_return(Nokogiri::HTML(credits_page_html))
+ show_loader.stub(:p_credits).and_return(credits_page_html)
}
describe "#credits [protected]" do
subject { show_loader.send(:credits) }
@@ -80,7 +80,7 @@
context "unpublished show" do
let(:show_number) { 33 }
before {
- show_loader.spider.stub(:get_page).and_return(Nokogiri::HTML(unpublished_show_page_html))
+ show_loader.spider.stub(:get_page).and_return(unpublished_show_page_html)
show_loader.stub(:show_notes).and_return([])
show_loader.scan_show_assets
}
@@ -40,7 +40,7 @@
context "valid uri" do
before {
# Bypassing true integration tests that make real web calls for now ...
- spider.stub(:get_page).and_return(Nokogiri::HTML(published_show_page_html))
+ spider.stub(:get_page).and_return(published_show_page_html)
}
it { should be_a(Nokogiri::HTML::Document) }
end
Oops, something went wrong.

0 comments on commit f0ab432

Please sign in to comment.