Class: EventMachine::MockHttpRequest
Defined Under Namespace
Classes: FakeHttpClient
Constant Summary
collapse
- @@registry =
nil
- @@registry_count =
nil
- @@pass_through_requests =
true
Instance Attribute Summary
Attributes inherited from HttpRequest
#method, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from HttpRequest
#delete, #get, #head, #initialize, #post, #put
Class Method Details
.count(uri, method) ⇒ Object
52
53
54
55
|
# File 'lib/em-http/mock.rb', line 52
def self.count(uri, method)
method = method.to_s.upcase
@@registry_count[uri][method]
end
|
.pass_through_requests ⇒ Object
39
40
41
|
# File 'lib/em-http/mock.rb', line 39
def self.pass_through_requests
@@pass_through_requests
end
|
.pass_through_requests=(pass_through_requests) ⇒ Object
35
36
37
|
# File 'lib/em-http/mock.rb', line 35
def self.pass_through_requests=(pass_through_requests)
@@pass_through_requests = pass_through_requests
end
|
.register(uri, method, data) ⇒ Object
43
44
45
46
|
# File 'lib/em-http/mock.rb', line 43
def self.register(uri, method, data)
method = method.to_s.upcase
@@registry[uri][method] = data
end
|
.register_file(uri, method, file) ⇒ Object
48
49
50
|
# File 'lib/em-http/mock.rb', line 48
def self.register_file(uri, method, file)
register(uri, method, File.read(file))
end
|
.reset_counts! ⇒ Object
22
23
24
|
# File 'lib/em-http/mock.rb', line 22
def self.reset_counts!
@@registry_count = Hash.new{|h,k| h[k] = Hash.new(0)}
end
|
.reset_registry! ⇒ Object
26
27
28
|
# File 'lib/em-http/mock.rb', line 26
def self.reset_registry!
@@registry = Hash.new{|h,k| h[k] = {}}
end
|
Instance Method Details
#real_send_request ⇒ Object
57
|
# File 'lib/em-http/mock.rb', line 57
alias_method :real_send_request, :send_request
|