spy_rb 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/spy/instance/api/internal.rb +4 -4
- data/lib/spy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64d02da3ec411aeb9266e4a61a295444c3cfcb39
|
4
|
+
data.tar.gz: f03057fc9d0291fd1b50c2253a3b346e734a055a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d8a048abf6d0856beb2887accce5d074eb81880e3ee5c3cf769631476eb956be7a85b7acd98c05e61f186b8c508008b57db9771cf69cea40a9f44fd6f1c39fc
|
7
|
+
data.tar.gz: 2149e676609384f4adb744f0b5434a86c73c25ec6b2f742cb80b8a4c7b038a72e9e4ca86c0c77736d38faf6b37d3db338bed98eb220d830eb8c6f46922104884
|
@@ -28,12 +28,12 @@ module Spy
|
|
28
28
|
# This will let us be a bit more elegant about how we do before/after
|
29
29
|
# callbacks. We can also merge MethodCall with this responsibility so
|
30
30
|
# it isn't just a data struct
|
31
|
-
is_active = @conditional_filters.all? {|f| f.call(*args)}
|
31
|
+
is_active = @conditional_filters.all? {|f| f.call(receiver, *args)}
|
32
32
|
|
33
33
|
if !is_active
|
34
34
|
call_original(receiver, *args, &block)
|
35
35
|
else
|
36
|
-
@before_callbacks.each {|f| f.call(*args)}
|
36
|
+
@before_callbacks.each {|f| f.call(receiver, *args)}
|
37
37
|
|
38
38
|
if @around_procs.any?
|
39
39
|
# Procify the original call
|
@@ -45,13 +45,13 @@ module Spy
|
|
45
45
|
|
46
46
|
# Keep wrapping the original proc with each around_proc
|
47
47
|
@around_procs.reduce(original_proc) do |p, wrapper|
|
48
|
-
Proc.new { wrapper.call *args, &p }
|
48
|
+
Proc.new { wrapper.call receiver, *args, &p }
|
49
49
|
end.call
|
50
50
|
else
|
51
51
|
result = call_and_record(receiver, *args, &block)
|
52
52
|
end
|
53
53
|
|
54
|
-
@after_callbacks.each {|f| f.call(*args)}
|
54
|
+
@after_callbacks.each {|f| f.call(receiver, *args)}
|
55
55
|
|
56
56
|
result
|
57
57
|
end
|
data/lib/spy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spy_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Bodah
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Spy brings everything that's great about Sinon.JS to Ruby. Mocking frameworks
|
14
14
|
work by stubbing out functionality. Spy works by listening in on functionality and
|