fakes 1.1.5 → 1.1.6
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/fakes/ignore_set.rb +1 -1
- data/lib/fakes/method_stub.rb +4 -0
- data/lib/fakes/version.rb +1 -1
- data/spec/specs/fake_spec.rb +14 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c20f921df7c9442a9ab155551c1c30dd9cc699b
|
4
|
+
data.tar.gz: f4e4ee5c51b4d35a4a66df43f4519220584b0042
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96d3ad483616587edfc4539c7d3ca60349574ffe177013ad39d30c222c7dea0ef58be6303fce331817a1a0f94d7462b2e9ac826462962804f1d236a1942b7c45
|
7
|
+
data.tar.gz: 8a97d132b73d18a9a42bbcc2d5145c7c25e278dac7658dc782509845cea7d95f9a2352affe605a680154bfda9ae9a7d8d388eea5ac8bcaaa8e8b12cdd0afe095
|
data/lib/fakes/ignore_set.rb
CHANGED
data/lib/fakes/method_stub.rb
CHANGED
data/lib/fakes/version.rb
CHANGED
data/spec/specs/fake_spec.rb
CHANGED
@@ -296,12 +296,24 @@ module Fakes
|
|
296
296
|
it 'should be able to determine if it received a method call' do
|
297
297
|
fake = Fake.new
|
298
298
|
fake.hello(1,[1,2,3,4])
|
299
|
-
|
299
|
+
|
300
300
|
expect(fake.received?(:hello,1,[1,2,3,4])).to be_true
|
301
301
|
expect(fake.received?(:hello)).to be_true
|
302
302
|
end
|
303
|
-
|
303
|
+
end
|
304
|
+
context 'running a block when a call is made' do
|
305
|
+
it 'runs the block with arguments provided and returns value of the block' do
|
306
|
+
fake = Fake.new
|
304
307
|
|
308
|
+
fake.stub(:hello).run do |name|
|
309
|
+
expect(name).to eql('JP')
|
310
|
+
2
|
311
|
+
end
|
312
|
+
|
313
|
+
result = fake.hello('JP')
|
314
|
+
|
315
|
+
expect(result).to eql(2)
|
316
|
+
end
|
305
317
|
end
|
306
318
|
end
|
307
319
|
end
|