lib/smoke/request.rb in benschwarz-smoke-0.4.2 vs lib/smoke/request.rb in benschwarz-smoke-0.5.0

- old
+ new

@@ -21,17 +21,13 @@ @uri, @options = uri, options dispatch end private - def dispatch - Smoke::Cache.fetch @uri do - Thread.new { - request = RestClient.get(@uri, @@request_options) - @content_type = request.headers[:content_type] - @body = request - }.join - end + def dispatch + get = Smoke::Cache.fetch @uri, @@request_options + @body = get[:body] + @content_type = get[:content_type] present! unless @options[:raw_response] rescue RestClient::Exception => e Failure.new(@uri, e) \ No newline at end of file