Module: Ww::Double::Spy
- Defined in:
- lib/ww/double/spy.rb,
lib/ww/double/spy/request.rb
Defined Under Namespace
Modules: InstanceMethods
Classes: Request
Instance Method Summary
collapse
Instance Method Details
#requests ⇒ Object
20
21
22
|
# File 'lib/ww/double/spy.rb', line 20
def requests
@requests ||= Store.new
end
|
#spy(verb, path, &block) ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/ww/double/spy.rb', line 7
def spy(verb, path, &block)
action = Double.unbound_action(self, "_spy_ #{verb.to_s.upcase} #{path}", block)
stub(verb, path) do |*args|
spy!
action.bind(self).call(*args)
end
end
|
#spy_them_all! ⇒ Object
16
17
18
|
# File 'lib/ww/double/spy.rb', line 16
def spy_them_all!
before { spy! }
end
|
#store(req) ⇒ Object
24
25
26
|
# File 'lib/ww/double/spy.rb', line 24
def store(req)
requests.store(Request.new(req))
end
|