corindon 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/corindon/dependency_injection/testing/mock_utils.rb +20 -1
- data/lib/corindon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9899f5321cf96c41569182938051a815f5baed7d04bda1f88a649c21b50df0b3
|
4
|
+
data.tar.gz: c6a9495fc8c46760fb5a09780bc8bbc12ae95deb4e0d7331042f7640f0d380d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66590e780392422933ccceb3596bb9e97d4ef6eb9e4d5685847cfe128b5f5d0a196723aa626f5bab711b011dad84a5987fc2b1946dd850b0e255226308bdd18a
|
7
|
+
data.tar.gz: bd262475a0fa7d10b565ef357d066db7b94c310eff89188438683ff26322de2fb5bcf87398b676ded30ef0fac18c81d251cb0c0f217ed20208bd02ba96a0629e
|
@@ -10,11 +10,30 @@ module Corindon
|
|
10
10
|
# @param [Definition] definition
|
11
11
|
# @param [Object] value
|
12
12
|
def mock_definition(definition, value)
|
13
|
+
singleton_class.prepend MockUtils unless is_a?(MockUtils)
|
14
|
+
|
13
15
|
add_definition(definition) if !has?(definition)
|
14
16
|
|
15
|
-
|
17
|
+
id = to_id(definition)
|
18
|
+
mocks[definition] = services[id] = value
|
16
19
|
end
|
17
20
|
end
|
21
|
+
|
22
|
+
using self
|
23
|
+
|
24
|
+
def mocks
|
25
|
+
@mocks ||= {}
|
26
|
+
end
|
27
|
+
|
28
|
+
def dup
|
29
|
+
new_instance = super
|
30
|
+
|
31
|
+
mocks.each do |definition, value|
|
32
|
+
new_instance.mock_definition(definition, value)
|
33
|
+
end
|
34
|
+
|
35
|
+
new_instance
|
36
|
+
end
|
18
37
|
end
|
19
38
|
end
|
20
39
|
end
|
data/lib/corindon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corindon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rémi Piotaix
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic
|