public
Fork of relevance/tarantula
Description: a big hairy fuzzy spider that crawls your site, wreaking havoc
Homepage: http://opensource.thinkrelevance.com/wiki/tarantula
Clone URL: git://github.com/thechrisoshow/tarantula.git
Added tests for generate_reports error messages, and increased code 
coverage
Chris O'Sullivan (author)
Thu May 29 15:42:14 -0700 2008
commit  0c7e541a7a2fa4510da67050f82bda7e5a9d69ca
tree    e71c8666d939b53f8d5375010f8574107bfec2e0
parent  4864481583c5a144e83cd6bca27b73a4e327bdd0
...
103
104
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
107
108
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
0
@@ -103,6 +103,29 @@ describe 'Relevance::Tarantula::Crawler#report_results' do
0
     crawler.expects(:generate_reports)
0
     crawler.report_results
0
   end
0
+
0
+ it "should raise an error if one of the report raises an error" do
0
+ crawler = Crawler.new
0
+ Relevance::Tarantula::IOReporter.any_instance.stubs(:finish_report).raises(RuntimeError)
0
+ should.raise {crawler.report_results}
0
+ end
0
+
0
+ it "should remember reporter error message" do
0
+ crawler = Crawler.new
0
+ Relevance::Tarantula::IOReporter.any_instance.stubs(:finish_report).raises(RuntimeError, "bananas")
0
+ exception = should.raise {crawler.report_results}
0
+ assert_match /bananas/, exception.message
0
+ end
0
+
0
+ it "should remember several reporter error messages with carriage return delimiter" do
0
+ new_reporter = Relevance::Tarantula::IOReporter.new($stderr)
0
+ crawler = Crawler.new
0
+ crawler.stubs(:reporters).returns([new_reporter, new_reporter])
0
+ Relevance::Tarantula::IOReporter.any_instance.stubs(:finish_report).raises(RuntimeError, "bananas")
0
+ exception = should.raise {crawler.report_results}
0
+ assert_match /bananas\nbananas/, exception.message
0
+ end
0
+
0
 end
0
 
0
 describe 'Relevance::Tarantula::Crawler#crawling' do

Comments

    No one has commented yet.