recursive_spy 0.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/recursive_spy.rb +25 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 59936ae7157f00c8ceb54b2ebe66b5a84ac367bba3c35ab3808e15867c97e2aa
4
+ data.tar.gz: 301719fadc344a0a67774cca327f8221bffd68914be773e6b3254bae3a415a88
5
+ SHA512:
6
+ metadata.gz: cca706b7ce15eba4b61b82cf47ca7400e63f36c42710510e58e53f3f529999510818a0593a28528fcb43a2753c6ba9ab59d88121d439f657e3d9c01e213e4596
7
+ data.tar.gz: 04fdaaacefeae53a494754221b23e7e360322a2d76d7161cf86b3941c9c083afdb16d07969f59068b659c3f2d3a5181dbfcae008581363d378a5fd2149cb132f
@@ -0,0 +1,25 @@
1
+ class RecursiveSpy
2
+ attr_reader :calls
3
+
4
+ def initialize
5
+ @calls = {}
6
+ end
7
+
8
+ def method_missing(method, *args)
9
+ value = self.class.new
10
+ @calls[method] ||= []
11
+ @calls[method] << MethodInvocation.new(
12
+ value,
13
+ args
14
+ )
15
+ value
16
+ end
17
+
18
+ class MethodInvocation
19
+ attr_reader :value, :args
20
+ def initialize(value, args)
21
+ @value = value
22
+ @args = args
23
+ end
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: recursive_spy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Nicholson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A recursive spy for code forensics and testing
14
+ email: nicholsonsoftware@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/recursive_spy.rb
20
+ homepage: https://github.com/anicholson44/recursive_spy
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.1.2
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: A recursive spy for code forensics and testing
43
+ test_files: []