Permalink
Browse files

Updated download worker test to make it green

  • Loading branch information...
1 parent 7cddaa9 commit 929de77d19623cba00e42b23117ff3e7168d300e @fabrizioc1 committed Jan 30, 2011
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/tarantula/download_worker.rb
  2. +1 −1 spec/download_worker_spec.rb
@@ -1,10 +1,14 @@
require 'tarantula/worker'
+require 'net/http'
module Tarantula
class DownloadWorker < Worker
# To change this template use File | Settings | File Templates.
def process(resource)
-
+ uri = URI.parse(resource.url)
+ response = Net::HTTP.get_response(uri.host,uri.path)
+ resource.content = response.body
+ resource
end
end
end
@@ -7,7 +7,7 @@
describe "Download Worker" do
it "should download content from a url" do
- page = Tarantula::Page.new("http://www.sonystyle.com")
+ page = Tarantula::Page.new("http://www.sonystyle.com/")
download_worker = Tarantula::DownloadWorker.new
download_worker.process(page)

0 comments on commit 929de77

Please sign in to comment.