spy_rb 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55898bab27ef564a680183144ee52cbe455b9cad
4
- data.tar.gz: a28b7f6df39b320e244d8393cf7fa68d0e55240f
3
+ metadata.gz: 64d02da3ec411aeb9266e4a61a295444c3cfcb39
4
+ data.tar.gz: f03057fc9d0291fd1b50c2253a3b346e734a055a
5
5
  SHA512:
6
- metadata.gz: 4bb72ec7f9bf82804b4f18ff84c1c30fb19d2acc2af58948a3f3cd187bbfb81cb4bf52aa00b86e7593677c1803e77fee2209864619c6f55c39c1731b6cd3e561
7
- data.tar.gz: 7892ca56e20ed834d5b304883567f81e02abd72bb85b7ab851aa29321eb8689dba2a6c55ee12709ec80b5fbb1ac500dae5f3eda33e98fb82aa9fe7ea6aa1c36e
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
@@ -1,3 +1,3 @@
1
1
  module Spy
2
- VERSION = '0.4.1'
2
+ VERSION = '0.5.0'
3
3
  end
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.1
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-06-24 00:00:00.000000000 Z
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