Class: FbRails::Mock
- Inherits:
-
Object
show all
- Defined in:
- lib/fb_rails/mock.rb
Defined Under Namespace
Classes: Responder, Response
Class Method Summary
collapse
Class Method Details
.find_response(path) ⇒ Object
34
35
36
37
|
# File 'lib/fb_rails/mock.rb', line 34
def find_response(path)
path = path.gsub(/\?.*$/, '').gsub(/^\//, '')
responses[path]
end
|
.reset! ⇒ Object
30
31
32
|
# File 'lib/fb_rails/mock.rb', line 30
def reset!
responses.clear
end
|
.respond_to {|Responder.new(responses)| ... } ⇒ Object
26
27
28
|
# File 'lib/fb_rails/mock.rb', line 26
def respond_to
yield Responder.new(responses)
end
|
.responses ⇒ Object
22
23
24
|
# File 'lib/fb_rails/mock.rb', line 22
def responses
@@responses ||= {}
end
|