much-stub 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: 21883570fda48199a217f7489b6c45f6d3c2e1d1cb5aa872847e154033754771
4
- data.tar.gz: bf63e826137aa1d315d48823c7a11787a09be559b16abc600a168edc19ff9068
3
+ metadata.gz: f4801d3a180d37bd01d02a52d1c524d38f432e4bb287a87d1e7753825efb180a
4
+ data.tar.gz: 422762b6602a2f05725fd61561e745bced7430b3e459ee7198a670ce86e922bd
5
5
  SHA512:
6
- metadata.gz: 7f6c8c294b7f7d006b3c88a3890d24e3ff913110caa11b70642d7ba246449dd3dcb20de0df46e939d90a9b917f0c509144c260fdbfc689f6a89be1f9fb5b942f
7
- data.tar.gz: 6a7c16b6b19625ad5b84df6d5413119a921f81425278f5f3b8c0b579895c9a22e8de58da349e56684412d93a74f450ba6e7ed2b53f06ad9185f9cf8ee31ec1a5
6
+ metadata.gz: 3eb227fd853591c057e7869a6331cbd36ba0a308eb4a0a3a32313ea779ec740f89e32a297160fb40bd3400222af83693830c260df3c461d79d40e72d45d1df24
7
+ data.tar.gz: 8b7ab33cb886b60f4242bdaa6a1bcf9a5d1666c2b37a335eb01ab032d59841ff648b5bed5ffded02dfd40f2fe4451e1649ae45488a133c6773ef00670ae760d7
@@ -54,10 +54,8 @@ module MuchStub
54
54
  end
55
55
 
56
56
  def call_spy_return_value_proc(method_name)
57
- value = @call_spy_return_values[method_name]
58
- return value if value.respond_to?(:call)
59
-
60
- ::Proc.new { value.nil? ? self : value }
57
+ value = @call_spy_return_values.fetch(method_name, ::Proc.new { self })
58
+ value.respond_to?(:call) ? value : ::Proc.new { value }
61
59
  end
62
60
 
63
61
  def call_spy_normalize_method_name(name)
@@ -1,3 +1,3 @@
1
1
  module MuchStub
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -93,4 +93,16 @@ class MuchStub::CallSpy
93
93
  assert_equal @result, subject.get.set!("value1").any?
94
94
  end
95
95
  end
96
+
97
+ class InitWithNilReturnValuesTests < UnitTests
98
+ desc "when init with nil return values"
99
+ setup do
100
+ @spy = @unit_class.new(result: nil)
101
+ end
102
+ subject{ @spy }
103
+
104
+ should "return nil" do
105
+ assert_equal "nil", subject.get.set!("value1").result.inspect
106
+ end
107
+ end
96
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: much-stub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-09-01 00:00:00.000000000 Z
12
+ date: 2020-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: assert