lib/webmock/response.rb in webmock-1.4.0 vs lib/webmock/response.rb in webmock-1.5.0
- old
+ new
@@ -78,11 +78,11 @@
self.body = options[:body]
self.exception = options[:exception]
@should_timeout = options[:should_timeout]
end
- def evaluate!(request_signature)
+ def evaluate(request_signature)
self.body = @body.call(request_signature) if @body.is_a?(Proc)
self.headers = @headers.call(request_signature) if @headers.is_a?(Proc)
self.status = @status.call(request_signature) if @status.is_a?(Proc)
@should_timeout = @should_timeout.call(request_signature) if @should_timeout.is_a?(Proc)
@exception = @exception.call(request_signature) if @exception.is_a?(Proc)
@@ -134,15 +134,11 @@
def initialize(responder)
@responder = responder
end
- def dup
- self.class.new(@responder)
- end
-
- def evaluate!(request_signature)
- self.options = @responder.call(request_signature)
- self
+ def evaluate(request_signature)
+ options = @responder.call(request_signature)
+ Response.new(options)
end
end
end