spy 1.0.1 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa89505674a7286f055ee019988cf29debbdd5cb7e525a022864f551d20ae842
4
- data.tar.gz: fa61fa5e78f5aea6fab75bcc471bdcc8032182d8e9c7528e9370b91022ef7ae0
3
+ metadata.gz: 46c870bafa6e5402e585dc44ea855f5e22a8087b4c14f70fad8794b39ac425a0
4
+ data.tar.gz: c9552993d8b0e335defead206a238c0342ea461102722f6702f04ae8a823f100
5
5
  SHA512:
6
- metadata.gz: abb91b0bcef139e03b90cb59f2f1b5d9f0c52c8137beafab301f56a96d44dbcffc203bcf0c69cd7e5376bed68549e0bb9bf407b4f85e07fc91d875d401ce39d0
7
- data.tar.gz: 58d355373220b031ba5740b0cfdc2a6d9bb94a7c39166fafae23896342eec3c3b907994f7224e80abc7f2d1ae289048d98cd56a05750569befa62c98f6330a22
6
+ metadata.gz: 5b476de3ea3a4f01a85ed3f99d51ed7c38785f67c9c7b565607e6e0edd027eeb643bc2fe43a92b8bdcfc7054e149c6e75022489bccaa3b7678f4239263152094
7
+ data.tar.gz: 16d976fa766805c685f7198fe219a55802d29a4d560ec7f984c229c751905c81fe0622a8887fc71c0c87845a48d40d283fdb4f0411d2c3ded2d72673bddfe1e1
@@ -0,0 +1,38 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ "master" ]
13
+ pull_request:
14
+ branches: [ "master" ]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ test:
21
+
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ matrix:
25
+ ruby-version: ['2.7', '3.0', '3.1']
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - name: Set up Ruby
30
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
31
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
32
+ # uses: ruby/setup-ruby@v1
33
+ uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
34
+ with:
35
+ ruby-version: ${{ matrix.ruby-version }}
36
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
37
+ - name: Run tests
38
+ run: bundle exec rake
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.7.0
1
+ ruby 3.1.2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## Spy 1.0.4 (December 21th, 2022) ##
2
+
3
+ * remove usage of #present? (@ryanong)
4
+
5
+ ## Spy 1.0.4 (December 21th, 2022) ##
6
+
7
+ * Hash as argument got turned into keyword arguments (@svenpl)
8
+ * drop support for ruby older than 2.7 (@ryanong)
9
+
10
+ ## Spy 1.0.3 (September 15, 2022) ##
11
+
12
+ * Fix private method call errors for older ruby versions (@dylanahsmith)
13
+ * `Spy.on_instance_method` and `and_call_through` on `#to_ary-able` class causes an error (@mizukami234)
14
+ * Fix `and_return` on class method (@jfirebaugh)
15
+
16
+ ## Spy 1.0.2 (January 10, 2022) ##
17
+
18
+ * Fix subroutine call with hash as last arg (@dtheo-ad)
19
+ * Ruby 2.7+ support (@casperisfine)
20
+
1
21
  ## Spy 1.0.1 (August 20th, 2020) ##
2
22
 
3
23
  * Fix call_through w/ instance methods (@lreeves)
data/README.md CHANGED
@@ -9,8 +9,7 @@
9
9
 
10
10
  Spy is a lightweight stubbing framework with support for method spies, constant stubs, and object mocks.
11
11
 
12
- Spy supports ruby 2.1.0+.
13
- For versions less than 2.1 use v0.4.5
12
+ Spy supports ruby 2.7.0+.
14
13
 
15
14
  Spy features that were completed were tested against the rspec-mocks tests so it covers all cases that rspec-mocks does.
16
15
 
@@ -47,7 +46,7 @@ Fail faster, code faster.
47
46
  * you can usually just check the call logs.
48
47
  * if you do need to use this. It is probably a code smell. You either need to abstract your method more or add separate tests.
49
48
  * you want to use dumb double, Spy has smart mocks, they are better
50
- * you use `mock_model` and `stub_model` (I want to impliment this soon)
49
+ * you use `mock_model` and `stub_model`
51
50
 
52
51
  ## Installation
53
52
 
@@ -87,7 +86,7 @@ Spy::Subroutine.new(book, :flamethrower).hook(force:true).and_return("burnninant
87
86
  ```
88
87
 
89
88
  You can also stub instance methods of Classes and Modules. This is equivalent to
90
- rspec-mock's `Module#any_instance`
89
+ rspec-mock's `allow_any_instance_of(Module)`
91
90
 
92
91
  ```ruby
93
92
  Spy.on_instance_method(Book, :title).and_return("Cannery Row")
data/lib/spy/call_log.rb CHANGED
@@ -10,6 +10,9 @@ module Spy
10
10
  # @!attribute [r] args
11
11
  # @return [Array] arguments were sent to the method
12
12
  #
13
+ # @!attribute [r] kwargs
14
+ # @return [Array] keyword arguments were sent to the method
15
+ #
13
16
  # @!attribute [r] block
14
17
  # @return [Proc] the block that was sent to the method
15
18
  #
@@ -17,10 +20,10 @@ module Spy
17
20
  # @return The result of the method of being stubbed, or called through
18
21
 
19
22
 
20
- attr_reader :object, :called_from, :args, :block, :result
23
+ attr_reader :object, :called_from, :args, :kwargs, :block, :result
21
24
 
22
- def initialize(object, called_from, args, block, result)
23
- @object, @called_from, @args, @block, @result = object, called_from, args, block, result
25
+ def initialize(object, called_from, args, kwargs, block, result)
26
+ @object, @called_from, @args, @kwargs, @block, @result = object, called_from, args, kwargs, block, result
24
27
  end
25
28
  end
26
29
  end
@@ -33,6 +33,7 @@ module Spy
33
33
  @base_object, @method_name = object, method_name
34
34
  @singleton_method = singleton_method
35
35
  @plan = nil
36
+ @call_through = false
36
37
  reset!
37
38
  end
38
39
 
@@ -58,14 +59,14 @@ module Spy
58
59
 
59
60
  if singleton_method
60
61
  if base_object.singleton_class.method_defined?(method_name) || base_object.singleton_class.private_method_defined?(method_name)
61
- base_object.singleton_class.alias_method(method_name, method_name)
62
+ base_object.singleton_class.send(:alias_method, method_name, method_name)
62
63
  end
63
64
  base_object.define_singleton_method(method_name, override_method)
64
65
  else
65
66
  if base_object.method_defined?(method_name) || base_object.private_method_defined?(method_name)
66
- base_object.alias_method(method_name, method_name)
67
+ base_object.send(:alias_method, method_name, method_name)
67
68
  end
68
- base_object.define_method(method_name, override_method)
69
+ base_object.send(:define_method, method_name, override_method)
69
70
  end
70
71
 
71
72
  if [:public, :protected, :private].include? hook_opts[:visibility]
@@ -83,7 +84,7 @@ module Spy
83
84
  raise NeverHookedError, "'#{method_name}' method has not been hooked" unless hooked?
84
85
 
85
86
  method_owner.send(:remove_method, method_name)
86
- if original_method && method_owner == original_method.owner
87
+ if original_method
87
88
  original_method.owner.send(:define_method, method_name, original_method)
88
89
  original_method.owner.send(original_method_visibility, method_name) if original_method_visibility
89
90
  end
@@ -148,28 +149,7 @@ module Spy
148
149
  # tells the spy to call the original method
149
150
  # @return [self]
150
151
  def and_call_through
151
- if @base_object.is_a? Class
152
- @plan = Proc.new do |object, *args, &block|
153
- if original_method
154
- if original_method.is_a? UnboundMethod
155
- bound_method = original_method.bind(object)
156
- bound_method.call(*args, &block)
157
- else
158
- original_method.call(*args, &block)
159
- end
160
- else
161
- base_object.send(:method_missing, method_name, *args, &block)
162
- end
163
- end
164
- else
165
- @plan = Proc.new do |*args, &block|
166
- if original_method
167
- original_method.call(*args, &block)
168
- else
169
- base_object.send(:method_missing, method_name, *args, &block)
170
- end
171
- end
172
- end
152
+ @call_through = true
173
153
 
174
154
  self
175
155
  end
@@ -221,30 +201,28 @@ module Spy
221
201
  # check if the method was called with the exact arguments
222
202
  # @param args Arguments that should have been sent to the method
223
203
  # @return [Boolean]
224
- def has_been_called_with?(*args, &block)
204
+ def has_been_called_with?(*args, **kwargs, &block)
225
205
  raise NeverHookedError unless @was_hooked
226
- match = block_given? ? block : proc { |call| call.args == args }
206
+ match = block_given? ? block : proc { |call| call.args == args && call.kwargs == kwargs }
227
207
  calls.any?(&match)
228
208
  end
229
209
 
230
210
  # invoke that the method has been called. You really shouldn't use this
231
211
  # method.
232
- def invoke(object, args, block, called_from)
233
- check_arity!(args.size)
234
-
235
- if base_object.is_a? Class
236
- result = if @plan
237
- check_for_too_many_arguments!(@plan)
238
- @plan.call(object, *args, &block)
239
- end
240
- else
241
- result = if @plan
242
- check_for_too_many_arguments!(@plan)
243
- @plan.call(*args, &block)
244
- end
245
- end
212
+ def invoke(object, args, kwargs, block, called_from)
213
+ arity = args.size
214
+ arity += 1 if !kwargs&.empty?
215
+ check_arity!(arity)
216
+
217
+ result =
218
+ if @call_through
219
+ call_plan(build_call_through_plan(object), block, *args, **kwargs)
220
+ elsif @plan
221
+ check_for_too_many_arguments!(@plan)
222
+ call_plan(@plan, block, *args, **kwargs)
223
+ end
246
224
  ensure
247
- calls << CallLog.new(object, called_from, args, block, result)
225
+ calls << CallLog.new(object, called_from, args, kwargs, block, result)
248
226
  end
249
227
 
250
228
  # reset the call log
@@ -261,11 +239,12 @@ module Spy
261
239
  # we use eval to set the spy object id as a parameter so it can be extracted
262
240
  # and looked up later using `Method#parameters`
263
241
  SPY_ARGS_PREFIX='__spy_args_'.freeze
242
+ SPY_KWARGS_PREFIX='__spy_kwargs_'.freeze
264
243
  def override_method
265
244
  eval <<-METHOD, binding, __FILE__, __LINE__ + 1
266
245
  __method_spy__ = self
267
- lambda do |*#{SPY_ARGS_PREFIX}#{self.object_id}, &block|
268
- __method_spy__.invoke(self, #{SPY_ARGS_PREFIX}#{self.object_id}, block, caller(1)[0])
246
+ lambda do |*#{SPY_ARGS_PREFIX}#{self.object_id}, **#{SPY_KWARGS_PREFIX}#{self.object_id}, &block|
247
+ __method_spy__.invoke(self, #{SPY_ARGS_PREFIX}#{self.object_id}, #{SPY_KWARGS_PREFIX}#{self.object_id}, block, caller(1)[0])
269
248
  end
270
249
  METHOD
271
250
  end
@@ -355,6 +334,24 @@ module Spy
355
334
  @method_owner ||= current_method.owner
356
335
  end
357
336
 
337
+ def build_call_through_plan(object)
338
+ if original_method
339
+ if @base_object.is_a?(Class) && original_method.is_a?(UnboundMethod)
340
+ original_method.bind(object)
341
+ else
342
+ original_method
343
+ end
344
+ else
345
+ Proc.new do |*args, &block|
346
+ base_object.send(:method_missing, method_name, *args, &block)
347
+ end
348
+ end
349
+ end
350
+
351
+ def call_plan(plan, block, *args, **kwargs)
352
+ plan.call(*args, **kwargs, &block)
353
+ end
354
+
358
355
  class << self
359
356
 
360
357
  # retrieve the method spy from an object or create a new one
data/lib/spy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spy
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.5"
3
3
  end
data/spy.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'spy/version'
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "spy"
8
8
  gem.version = Spy::VERSION
9
- gem.required_ruby_version = '>= 2.1.0'
9
+ gem.required_ruby_version = '>= 2.7.0'
10
10
  gem.license = 'MIT'
11
11
  gem.authors = ["Ryan Ong"]
12
12
  gem.email = ["ryanong@gmail.com"]
@@ -0,0 +1,24 @@
1
+ require 'test_helper'
2
+
3
+ class TestClassMethod < Minitest::Test
4
+ def teardown
5
+ Spy::Agency.instance.dissolve!
6
+ end
7
+
8
+ def test_and_return
9
+ klass = Class.new do
10
+ def self.class_method(*args, &block)
11
+ end
12
+ end
13
+ received_args = nil
14
+ received_block = nil
15
+ Spy.on(klass, :class_method).and_return do |*args, &block|
16
+ received_args = args
17
+ received_block = block
18
+ end
19
+ block = -> {}
20
+ klass.class_method(:a, :b, &block)
21
+ assert_equal [:a, :b], received_args
22
+ assert_equal block, received_block
23
+ end
24
+ end
@@ -6,6 +6,10 @@ module Spy
6
6
  Subroutine.new(base_object, method_name).hook
7
7
  end
8
8
 
9
+ def spy_on_instance_method(base_object, method_name)
10
+ Subroutine.new(base_object, method_name, false).hook
11
+ end
12
+
9
13
  def setup
10
14
  @pen = Pen.new
11
15
  end
@@ -109,6 +113,15 @@ module Spy
109
113
  assert_empty @pen.written
110
114
  end
111
115
 
116
+ def test_spy_and_return_can_call_a_block_with_hash
117
+ result = "hello world"
118
+
119
+ spy_on(@pen, :write_hash).and_return { |**opts| opts[:test] }
120
+
121
+ assert_equal result, @pen.write_hash(test: result)
122
+ assert_empty @pen.written
123
+ end
124
+
112
125
  def test_spy_and_return_can_call_a_block_raises_when_there_is_an_arity_mismatch
113
126
  write_spy = spy_on(@pen, :write)
114
127
  write_spy.and_return do |*args|
@@ -137,6 +150,81 @@ module Spy
137
150
  assert_equal string, result
138
151
  end
139
152
 
153
+ def test_spy_and_call_through_with_hash_and_keyword_args
154
+ spy_on(@pen, 'hash_and_keyword_arg').and_call_through
155
+ hsh = { hello: 'world' }
156
+
157
+ assert_equal [hsh, nil], @pen.hash_and_keyword_arg(hsh)
158
+ assert_equal [hsh, 'foo'], @pen.hash_and_keyword_arg(hsh, keyword: 'foo')
159
+ end
160
+
161
+ def test_spy_and_call_through_returns_original_method_result
162
+ string = "hello world"
163
+
164
+ write_spy = spy_on(@pen, :write).and_call_through
165
+ another_spy = spy_on(@pen, :another).and_call_through
166
+
167
+ result = @pen.write(string)
168
+
169
+ assert_equal string, result
170
+ assert write_spy.has_been_called?
171
+ assert_equal 'another', @pen.another
172
+ assert another_spy.has_been_called?
173
+ end
174
+
175
+ def test_spy_and_call_through_with_hash_original_method
176
+ string = 'test:hello world'
177
+
178
+ write_spy = spy_on(@pen, :write_hash).and_call_through
179
+
180
+ @pen.write_hash(test: 'hello world')
181
+ assert_equal string, @pen.written.last
182
+ assert write_spy.has_been_called?
183
+ end
184
+
185
+ def test_spy_on_instance_and_call_through_returns_original_method_result
186
+ string = "hello world"
187
+
188
+ inst_write_spy = spy_on_instance_method(Pen, :write).and_call_through
189
+ inst_another_spy = spy_on_instance_method(Pen, :another).and_call_through
190
+
191
+ result = @pen.write(string)
192
+
193
+ assert_equal string, result
194
+ assert inst_write_spy.has_been_called?
195
+ assert_equal 'another', @pen.another
196
+ assert inst_another_spy.has_been_called?
197
+ end
198
+
199
+ def test_spy_on_instance_and_call_through_with_hash
200
+ string = 'test:hello world'
201
+
202
+ inst_write_spy = spy_on_instance_method(Pen, :write_hash).and_call_through
203
+
204
+ @pen.write_hash(test: 'hello world')
205
+
206
+ assert_equal string, @pen.written.last
207
+ assert inst_write_spy.has_been_called?
208
+ end
209
+
210
+ def test_spy_on_instance_and_call_through_to_aryable
211
+ to_aryable = Class.new do
212
+ def hello
213
+ 'hello'
214
+ end
215
+
216
+ def to_ary
217
+ [1]
218
+ end
219
+ end
220
+
221
+ inst_hello_spy = spy_on_instance_method(to_aryable, :hello).and_call_through
222
+ inst = to_aryable.new
223
+
224
+ assert_equal 'hello', inst.hello
225
+ assert inst_hello_spy.has_been_called?
226
+ end
227
+
140
228
  def test_spy_hook_records_number_of_calls
141
229
  pen_write_spy = spy_on(@pen, :write)
142
230
  assert_equal 0, pen_write_spy.calls.size
@@ -157,6 +245,20 @@ module Spy
157
245
  assert pen_write_spy.has_been_called_with?("hello")
158
246
  end
159
247
 
248
+ def test_has_been_called_with_kwargs
249
+ pen_write_spy = spy_on(@pen, :opt_kwargs)
250
+ refute pen_write_spy.has_been_called_with?("hello")
251
+
252
+ @pen.opt_kwargs("hello")
253
+ assert pen_write_spy.has_been_called_with?("hello")
254
+
255
+ @pen.opt_kwargs("world", opt: "hello")
256
+ assert pen_write_spy.has_been_called_with?("world", opt: "hello")
257
+
258
+ @pen.opt_kwargs("hello world", opt: "world", opt2: "hello")
259
+ assert pen_write_spy.has_been_called_with?("hello world", opt: "world", opt2: "hello")
260
+ end
261
+
160
262
  def test_spy_hook_records_number_of_calls2
161
263
  args = ["hello world"]
162
264
  block = Proc.new {}
@@ -0,0 +1,76 @@
1
+ require 'test_helper'
2
+
3
+ module Spy
4
+ class TestUnhook < Minitest::Test
5
+ module ModuleFunctionStyle
6
+ extend self
7
+
8
+ def hello
9
+ 'hello world'
10
+ end
11
+ end
12
+
13
+ module Injected
14
+ def hello
15
+ 'hello world'
16
+ end
17
+ end
18
+
19
+ class ModuleInjectedStyle
20
+ include Injected
21
+ end
22
+
23
+ class ModuleExtendedStyle
24
+ extend Injected
25
+ end
26
+
27
+ class SingletonMethodStyle
28
+ def self.hello
29
+ 'hello world'
30
+ end
31
+ end
32
+
33
+ class InstanceMethodStyle
34
+ def hello
35
+ 'hello world'
36
+ end
37
+ end
38
+
39
+ def test_ModuleFunctionStyle
40
+ spy = Spy.on(ModuleFunctionStyle, :hello).and_return('yo')
41
+ assert_equal ModuleFunctionStyle.hello, 'yo'
42
+ spy.unhook
43
+ assert_equal ModuleFunctionStyle.hello, 'hello world'
44
+ end
45
+
46
+ def test_ModuleInjectedStyle
47
+ instance = ModuleInjectedStyle.new
48
+ spy = Spy.on(instance, :hello).and_return('yo')
49
+ assert_equal instance.hello, 'yo'
50
+ spy.unhook
51
+ assert_equal instance.hello, 'hello world'
52
+ end
53
+
54
+ def test_ModuleExtendedStyle
55
+ spy = Spy.on(ModuleExtendedStyle, :hello).and_return('yo')
56
+ assert_equal ModuleExtendedStyle.hello, 'yo'
57
+ spy.unhook
58
+ assert_equal ModuleExtendedStyle.hello, 'hello world'
59
+ end
60
+
61
+ def test_SingletonMethodStyle
62
+ spy = Spy.on(SingletonMethodStyle, :hello).and_return('yo')
63
+ assert_equal SingletonMethodStyle.hello, 'yo'
64
+ spy.unhook
65
+ assert_equal SingletonMethodStyle.hello, 'hello world'
66
+ end
67
+
68
+ def test_InstanceMethodStyle
69
+ instance = InstanceMethodStyle.new
70
+ spy = Spy.on(instance, :hello).and_return('yo')
71
+ assert_equal instance.hello, 'yo'
72
+ spy.unhook
73
+ assert_equal instance.hello, 'hello world'
74
+ end
75
+ end
76
+ end
data/test/support/pen.rb CHANGED
@@ -27,10 +27,20 @@ class Pen
27
27
  end
28
28
  end
29
29
 
30
+ def write_hash(**params)
31
+ params.each do |p|
32
+ write(p.join(':'))
33
+ end
34
+ end
35
+
30
36
  def greet(hello = "hello", name)
31
37
  write("#{hello} #{name}")
32
38
  end
33
39
 
40
+ def hash_and_keyword_arg(hsh, keyword: nil)
41
+ [hsh, keyword]
42
+ end
43
+
34
44
  def public_method
35
45
  end
36
46
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ong
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-20 00:00:00.000000000 Z
11
+ date: 2022-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -117,9 +117,9 @@ executables: []
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
+ - ".github/workflows/ruby.yml"
120
121
  - ".gitignore"
121
122
  - ".tool-versions"
122
- - ".travis.yml"
123
123
  - ".yardopts"
124
124
  - CHANGELOG.md
125
125
  - Gemfile
@@ -139,37 +139,23 @@ files:
139
139
  - lib/spy/nest.rb
140
140
  - lib/spy/subroutine.rb
141
141
  - lib/spy/version.rb
142
- - spec/spec_helper.rb
143
- - spec/spy/and_call_original_spec.rb
144
- - spec/spy/and_yield_spec.rb
145
- - spec/spy/any_instance_spec.rb
146
- - spec/spy/hash_excluding_matcher_spec.rb
147
- - spec/spy/hash_including_matcher_spec.rb
148
- - spec/spy/mutate_const_spec.rb
149
- - spec/spy/nil_expectation_warning_spec.rb
150
- - spec/spy/null_object_mock_spec.rb
151
- - spec/spy/partial_mock_spec.rb
152
- - spec/spy/passing_argument_matchers_spec.rb
153
- - spec/spy/serialization_spec.rb
154
- - spec/spy/stash_spec.rb
155
- - spec/spy/stub_implementation_spec.rb
156
- - spec/spy/stub_spec.rb
157
- - spec/spy/to_ary_spec.rb
158
142
  - spy.gemspec
159
143
  - test/integration/test_api.rb
144
+ - test/integration/test_class_method.rb
160
145
  - test/integration/test_constant_spying.rb
161
146
  - test/integration/test_instance_method.rb
162
147
  - test/integration/test_mocking.rb
163
148
  - test/integration/test_subroutine_spying.rb
164
149
  - test/spy/test_mock.rb
165
150
  - test/spy/test_subroutine.rb
151
+ - test/spy/test_unhook.rb
166
152
  - test/support/pen.rb
167
153
  - test/test_helper.rb
168
154
  homepage: https://github.com/ryanong/spy
169
155
  licenses:
170
156
  - MIT
171
157
  metadata: {}
172
- post_install_message:
158
+ post_install_message:
173
159
  rdoc_options: []
174
160
  require_paths:
175
161
  - lib
@@ -177,41 +163,27 @@ required_ruby_version: !ruby/object:Gem::Requirement
177
163
  requirements:
178
164
  - - ">="
179
165
  - !ruby/object:Gem::Version
180
- version: 2.1.0
166
+ version: 2.7.0
181
167
  required_rubygems_version: !ruby/object:Gem::Requirement
182
168
  requirements:
183
169
  - - ">="
184
170
  - !ruby/object:Gem::Version
185
171
  version: '0'
186
172
  requirements: []
187
- rubygems_version: 3.1.2
188
- signing_key:
173
+ rubygems_version: 3.3.17
174
+ signing_key:
189
175
  specification_version: 4
190
176
  summary: A simple modern mocking library that uses the spy pattern and checks method's
191
177
  existence and arity.
192
178
  test_files:
193
- - spec/spec_helper.rb
194
- - spec/spy/and_call_original_spec.rb
195
- - spec/spy/and_yield_spec.rb
196
- - spec/spy/any_instance_spec.rb
197
- - spec/spy/hash_excluding_matcher_spec.rb
198
- - spec/spy/hash_including_matcher_spec.rb
199
- - spec/spy/mutate_const_spec.rb
200
- - spec/spy/nil_expectation_warning_spec.rb
201
- - spec/spy/null_object_mock_spec.rb
202
- - spec/spy/partial_mock_spec.rb
203
- - spec/spy/passing_argument_matchers_spec.rb
204
- - spec/spy/serialization_spec.rb
205
- - spec/spy/stash_spec.rb
206
- - spec/spy/stub_implementation_spec.rb
207
- - spec/spy/stub_spec.rb
208
- - spec/spy/to_ary_spec.rb
209
179
  - test/integration/test_api.rb
180
+ - test/integration/test_class_method.rb
210
181
  - test/integration/test_constant_spying.rb
211
182
  - test/integration/test_instance_method.rb
212
183
  - test/integration/test_mocking.rb
213
184
  - test/integration/test_subroutine_spying.rb
214
185
  - test/spy/test_mock.rb
215
186
  - test/spy/test_subroutine.rb
187
+ - test/spy/test_unhook.rb
216
188
  - test/support/pen.rb
217
189
  - test/test_helper.rb
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - '2.1'
4
- - '2.5'
5
- - '2.7'
6
- - jruby
7
- - ruby-head
8
- - rbx-3
9
- matrix:
10
- allow_failures:
11
- - rvm: ruby-head
12
- - rvm: rbx-3
13
- - rvm: jruby