lib/stella/data/http.rb in stella-0.7.6.005 vs lib/stella/data/http.rb in stella-0.7.6.007
- old
+ new
@@ -19,11 +19,14 @@
field :body
field :http_method
field :http_version
field :content_type
field :http_auth
+ field :timeout
+ field :autofollow # boolean. Was this an auto generated follow request.
+
# A hash containing blocks to be executed depending on the HTTP response status.
# The hash keys are numeric HTTP Status Codes.
#
# 200 => { ... }
# 304 => { ... }
@@ -38,17 +41,27 @@
def initialize (method, uri_str, version="1.1", &definition)
@uri = uri_str
@http_method, @http_version = method, version
@headers, @params, @response_handler = {}, {}, {}
@resources = {}
+ @autofollow = false
@wait = 0
self.description = "Request"
instance_eval &definition unless definition.nil?
end
- def auth(user=nil, pass=nil, kind=:basic)
+ def autofollow!
+ @autofollow = true
+ end
+
+ def auth(user=nil, pass=nil, domain=nil)
@http_auth ||= Stella::Testplan::Usecase::Auth.new
- @http_auth.user, @http_auth.pass, @http_auth.kind = user, pass, kind
+ @http_auth.user, @http_auth.pass, @http_auth.domain = user, pass, domain
+ end
+
+ def timeout(*args)
+ @timeout = args.first unless args.empty?
+ @timeout
end
def desc(*args)
self.description = args.first unless args.empty?
self.description
\ No newline at end of file